Secure login - Java server
Secure login - Java server
I can't find any MD5 functionality in the Java SFS API. Is it only present in the AS server API? I don't think MD5 is built into Java, are you aware of any free Java implementations?
By the way, why does the secureLogin example use a 3rd-party MD5 tool on the client side, when you must already have your own AS MD5 tool for the server?
By the way, why does the secureLogin example use a 3rd-party MD5 tool on the client side, when you must already have your own AS MD5 tool for the server?
User this
Hope it helps
Code: Select all
import it.gotoandplay.smartfoxserver.crypto;
...
...
MD5 md5 = MD5.instance();
String hash = md5.getHash("MyStringGoesHere");
Hope it helps
- thecreatrix
- Posts: 19
- Joined: 20 Aug 2008, 02:32
- Contact:
How do we get the server instance from Java? For example, in the tutorial it refers to the _server variable, but what's the equivalent in Java?
Thanks!
Edit: I see that SmartFoxServer.getInstance() returns a reference to the server, but I still cannot find any login calls (I also looked in AbstractExtension and ExtensionHelper).
It is mentioned in this tutorial that we can login a user (_server.loginUser()) after we authenticate, but the example is ActionScript, and I can't find the equivalent in Java. (SFS Pro 1.6.3)
Thanks!
Edit: I see that SmartFoxServer.getInstance() returns a reference to the server, but I still cannot find any login calls (I also looked in AbstractExtension and ExtensionHelper).
It is mentioned in this tutorial that we can login a user (_server.loginUser()) after we authenticate, but the example is ActionScript, and I can't find the equivalent in Java. (SFS Pro 1.6.3)
ExtensionHelper is the main entry point to the API.
All you have to do is keep a reference to it in your code:
In the javadoc you find all the details about each method.
Additionally in your Server/javaExtensions/ folder you find examples of java extensions with their sources.
All you have to do is keep a reference to it in your code:
Code: Select all
ExtensionHelper api = ExtensionHelper.getInstance()
In the javadoc you find all the details about each method.
Additionally in your Server/javaExtensions/ folder you find examples of java extensions with their sources.
- thecreatrix
- Posts: 19
- Joined: 20 Aug 2008, 02:32
- Contact:
- thecreatrix
- Posts: 19
- Joined: 20 Aug 2008, 02:32
- Contact:
I apologize for being thick headed here, but I'm still trying to get this custom handleInternalEvent() stuff to work.
When I call ExtensionHelper.instance().canLogin() to log a user in after authenticating credentials, the server doesn't seem to send any of the events that normally would be sent to the client upon default login. For example, my client no longer receives the SFSEvent.onLogIn event now that I am using the custom login in my extension. (I have verified that the user is indeed logging in successfully on the server side.)
Do we have to "manually" tell the server to fire these events? If so, is there documentation about how to do that?
Thanks!
Edit: I realize, also, that it may be that we need to not rely on the login events when using this custom method. That's fine, but I just want to know if that's the case or if I'm missing something.
When I call ExtensionHelper.instance().canLogin() to log a user in after authenticating credentials, the server doesn't seem to send any of the events that normally would be sent to the client upon default login. For example, my client no longer receives the SFSEvent.onLogIn event now that I am using the custom login in my extension. (I have verified that the user is indeed logging in successfully on the server side.)
Do we have to "manually" tell the server to fire these events? If so, is there documentation about how to do that?
Thanks!
Edit: I realize, also, that it may be that we need to not rely on the login events when using this custom method. That's fine, but I just want to know if that's the case or if I'm missing something.
- thecreatrix
- Posts: 19
- Joined: 20 Aug 2008, 02:32
- Contact:
I have now managed to implement this successfully by calling ExtensionHelper.sendRoomList() after the login succeeds. That fires the event to the client so it can handle the onRoomListUpdate event.
It would be nice if the tutorial got an update with a bit more information on how the login process changes when implemented using an internal event handler. Other than my initial confusion, though, SFS makes it very easy.
Cheers.
It would be nice if the tutorial got an update with a bit more information on how the login process changes when implemented using an internal event handler. Other than my initial confusion, though, SFS makes it very easy.
Cheers.
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 19 guests