jaas: How to authorization with gwt?

10 views
Skip to first unread message

thitoh

unread,
May 29, 2008, 2:41:44 PM5/29/08
to Google Web Toolkit
To authentication, I created a module with a form with action:
GWT.getModuleBaseURL() + "/j_security_check"
And add to the form a TextBox with name j_username, and a
PasswordTextBox with name j_password.
I add a button with a ClickListener with:
public void onClick(Widget sender) {
form.submit();
}
It works fine! The authentication is working....
But how do I verify the roles that the user has????????
My application policy in login-config.xml is:
<application-policy name = "appl">
<authentication>
<login-module
code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required">
<module-option name="usersProperties">props/appl-
users.properties</module-option>
<module-option name="rolesProperties">props/appl-
roles.properties</module-option>
</login-module>
</authentication>
</application-policy>

In props/appl-users.properties I put the users with passwords.. Like
this:
admin=passadmin
user2=mypassword
user3=12345

In props/appl-roles.properties I put the users and their roles.. Link
this:
admin=Administrators,Comm,Others
user2=Comm,White,Others
user3=Others

How do I verify in the user that is logged, has the role
Administrators, example... ?? What is the java code that I have to put
in a GWT Module?
Reply all
Reply to author
Forward
0 new messages