jWebSocket Forum

[Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
I want to make various user name when login.  XML
Forum Index » Server side Plug-Ins, Apps, Listeners and Filters
Author Message
ahnsb123

jWebSocket Forum User

Joined: 26/08/2011 23:17:07
Messages: 4
Offline



in more version 1.0,

We can't log in by using own username (which isn't specified in jwebsocket.xml).

Only guest, user, root, anonymous are permitted.

How can i implement login process by using different username ???

Do i have to modify jwebsocket.xml everytime when I wanna add user ?
aschulze

jWebSocket Owner
[Avatar]

Joined: 16/03/2010 18:15:55
Messages: 375
Location: Germany, Herzogenrath
Offline

Hi ahnsb123,

we are about to provide a new authentication API based on Spring Security which will allow you to authenticate against lots of different user repositories. Currently you either can put your users into the jWebSocket.xml or update the security factory class to allow your own authentication and authorization methods.
We will notify you as soon as we have news here! Please also track issue http://code.google.com/p/jwebsocket/issues/detail?id=44 for progress on this topic.
Thanks in advcance for your patience.

Best Regards
Alex
[WWW]
ahnsb123

jWebSocket Forum User

Joined: 26/08/2011 23:17:07
Messages: 4
Offline

Thank you for reply.
Yes, I will look forward to seeing that.

now, I'm using channel plugin in Chat app, not System plugin.

I mean using publish(), not broadcast() or send() when users use chat.

basically when they login, they login by 'user' accouts and gain authentication from escpeciall channel.

By modifying ChannelPlugin.jar.
I can add many type of Token values(e.g. different username).
In result, different user's chat in different channels was possible.

I'm trying to make collaboration tools in web browser using this awsome jWebsocket.

Sincerly.

This message was edited 1 time. Last update was at 02/09/2011 20:00:33

javaone9

jWebSocket Forum User

Joined: 02/10/2011 03:17:25
Messages: 8
Offline

Hi Alex,

>>Currently you either can put your users into the jWebSocket.xml or update the security factory class >>to allow your own authentication and authorization methods.

We need to authenticate users using existing database table. Could you please give me some info (doc)
on how to implement such factory and replacing existing one?

Can authentication be disabled?

Thanks for help.

Dave
javaone9

jWebSocket Forum User

Joined: 02/10/2011 03:17:25
Messages: 8
Offline

As a temporary solution, could you create Authentictor interface like the following:

public interface Authenticator {
User login(String username, String password) throw Exception;
}

JWebSocketFactory.setAuthenticator(authenticator);

If this is not possible, could you point me to the authentication code? I could not find it.

Thanks very much.
Dave
aschulze

jWebSocket Owner
[Avatar]

Joined: 16/03/2010 18:15:55
Messages: 375
Location: Germany, Herzogenrath
Offline

Hi Dave,

as you might have seen already, we are about to switch our security factory to use spring security for 1.0 final.
In our SVN repository we updated the System Plug In to load the new /conf/SystemPlugIn/system.xml spring configuration.
It will support JDBC auth, LDAP auth and static auth for now, further pending. It also supports EhCache to cache the user repositories.
I hope we are able to provide the new System PlugIn and the updated security factory, which then will support spring 3.0 security in jWebSocket 1.0b2, within this week.
You will find all authentication code in the SystemPlugin right now. But we will refactor further parts to be included in the security factory in the next days.

Thanks for your hints and your patience.

Best Regards
Alex
[WWW]
javaone9

jWebSocket Forum User

Joined: 02/10/2011 03:17:25
Messages: 8
Offline

Hi Alex,
Thanks for quick response. I look forward to seeing the DB auth in b2 this week.
This is a very nice project after the auth is solved.

Thanks,
Dave
Jerry

jWebSocket Forum Fan

Joined: 05/08/2011 09:49:30
Messages: 59
Offline

Hi,Alex,

I am also looking forward to 1.0 b2 version release .

BTW:you mentioned , it will switch the security factory to use spring security for 1.0 final. does it mean that security factory will not use any more in the future release. and if I use your new version to develop some application, we just use spring security feature , not security factory class , right ?

Thanks
Jerry
douduoyang

jWebSocket Forum User
[Avatar]

Joined: 18/02/2012 06:43:44
Messages: 19
Offline

Hi,
In the jwebsocket,only guest, user, root, anonymous are permitted. Putting users into the jWebSocket.xml is not a good solution.
so I have a user table and certain roles assignments. How can i implement login process by using different username with my own user table???

I have config System.xml as below ,but it didn’t work when I login in the channel demo:
<property name="authoritiesByUsernameQuery" value="
select users.account, roles.name
from user users
left join demo_roles roles on roles.role_id = users.role_id
where users.account = ?"/>
<property name="usersByUsernameQuery" value="
select account loginname, id password, enabled
from user where account = ?"/>

<property name="groupAuthoritiesByUsernameQuery" value="
select roles.role_id, roles.name, rights.name
from user users
left join demo_roles_rights rr on users.role_id = rr.role_id
left join demo_roles roles on roles.role_id = rr.role_id
left join demo_rights rights on rights.right_id = rr.right_id
where users.account = ?"/>
<property name="authoritiesByUsernameQuery" value="
select users.account, roles.name
from user users
left join demo_roles roles on roles.role_id = users.role_id
where users.account = ?"/>
<property name="usersByUsernameQuery" value="
select account loginname, id password, enabled from user
where account = ?"/>

Thank you. email:magic2key@gmail.com

This message was edited 1 time. Last update was at 18/02/2012 06:59:02

[Email]
douduoyang

jWebSocket Forum User
[Avatar]

Joined: 18/02/2012 06:43:44
Messages: 19
Offline

ahnsb123 wrote:Thank you for reply.
Yes, I will look forward to seeing that.

now, I'm using channel plugin in Chat app, not System plugin.

I mean using publish(), not broadcast() or send() when users use chat.

basically when they login, they login by 'user' accouts and gain authentication from escpeciall channel.

By modifying ChannelPlugin.jar.
I can add many type of Token values(e.g. different username).
In result, different user's chat in different channels was possible.

I'm trying to make collaboration tools in web browser using this awsome jWebsocket.

Sincerly.


Hi,ahnsb123
How did you achieve?Use the the username and password in native MySQL database ?

Thank you a lot,
doudouyang
[Email]
douduoyang

jWebSocket Forum User
[Avatar]

Joined: 18/02/2012 06:43:44
Messages: 19
Offline

I have solved it with recompiling the jwebsocket.
[Email]
Capstan

jWebSocket Forum User

Joined: 10/04/2012 18:38:14
Messages: 21
Offline

aschulze wrote:Hi ahnsb123,

we are about to provide a new authentication API based on Spring Security which will allow you to authenticate against lots of different user repositories. Currently you either can put your users into the jWebSocket.xml or update the security factory class to allow your own authentication and authorization methods.
We will notify you as soon as we have news here! Please also track issue http://code.google.com/p/jwebsocket/issues/detail?id=44 for progress on this topic.
Thanks in advcance for your patience.

Best Regards
Alex


I need to be able to either add users/passwords programmatically or have them be authenticated by means of a method I write myself in order for jws to be useful to me, I am sure other people are in the same situation.

I didn't see any new updates on the "issue" site, but looking at the system.xml file I do see references to LDAP, etc. Does this mean that the "new authentication API" has been implemented and released? Is there documentation somewhere that explains how to use it?

If not, where is the "security factory class" that was mentioned here?
vbarzana

jWebSocket Forum Fan
[Avatar]

Joined: 11/07/2011 09:13:42
Messages: 109
Offline

Hi all,
We are proud to introduce you the new Authentication system is ready, please, download the last Beta (6) from our nightly builds, it allows a new authentication mechanism based on spring, by the moment we only support:
* STATIC authentication.
* LDAP authentication.
* JDBC authentication.

We also support optional caching with ehcache if you wish, just configure it.

If you want to define your own authentication mechanism or see the existing ones, please, check the file JWEBSOCKET_HOME/conf/SystemPlugIn/system.xml.

The way to use it in the client is very easy, this is a little example of how to use it, for more information visit the demo fundamentals in the demo section:


Please, I repeat, check the fundamentals demo, If you use the auth function, you will receive a response like this one:


Best regards,
Victor
[WWW]
Capstan

jWebSocket Forum User

Joined: 10/04/2012 18:38:14
Messages: 21
Offline

I see the system.xml file and understand that it references several authentication classes in the spring framework, but I don't see how I could add my own authentication method. If I were to write a Java class that just accepted whatever name and password were submitted for example (as the most simple example) how would I get it to be instantiated and included?

I can see that "staticAuthProvider" is specified as the "authManager" in system.xml and the others are commented out. But I am not seeing in the documentation how to add an appropriate XML stanza that would describe a custom authentication class.
soumya

jWebSocket Forum User

Joined: 23/07/2012 11:59:43
Messages: 1
Offline

Is it possible to use existing users from our application database?
 
Forum Index » Server side Plug-Ins, Apps, Listeners and Filters
Go to:   
Powered by JForum 2.1.9 © JForum Team