public class AuthorizationManager extends Object
Overall description of the authentication and authorization process:
After a client connects, and indicates a desire to use SASL, the SASLAuthentication object decides which SASL mechanisms to advertise, and then performs the authentication. If authentication is successful, the XMPPCallbackHandler is asked to handle() an AuthorizeCallback. The XMPPCallbackHandler asks the AuthorizationManager to authorize the principal to the requested username. The AuthorizationManager manages a list of AuthorizationProvider classes, and tries them one at a time and returns true with the first AuthorizationProvider that authorizes the principal to the username. If no classes authorize the principal, false is returned, which traces all the way back to give the client an unauthorized message. Its important to note that the message the client receives will give no indication if the principal authenticated successfully, you will need to check the server logs for that information.Modifier and Type | Method and Description |
---|---|
static boolean |
authorize(String username,
String principal)
Authorize the authenticated used to the requested username.
|
static Collection<AuthorizationPolicy> |
getAuthorizationPolicies()
Returns the currently-installed AuthorizationProvider.
|
static String |
map(String principal)
Map the authenticated principal to the default username.
|
public static Collection<AuthorizationPolicy> getAuthorizationPolicies()
public static boolean authorize(String username, String principal)
username
- The requested username.principal
- The authenticated principal.public static String map(String principal)
principal
- The authentiated principal to determine the default username.Copyright © 2003-2008 Jive Software.