FileDocCategorySizeDatePackage
AuthorizeCallback.javaAPI DocJava SE 5 API3446Fri Aug 26 14:57:48 BST 2005javax.security.sasl

AuthorizeCallback

public class AuthorizeCallback extends Object implements Callback, Serializable
This callback is used by SaslServer to determine whether one entity (identified by an authenticated authentication id) can act on behalf of another entity (identified by an authorization id).
since
1.5
author
Rosanna Lee
author
Rob Weltman

Fields Summary
private String
authenticationID
The (authenticated) authentication id to check.
private String
authorizationID
The authorization id to check.
private String
authorizedID
The id of the authorized entity. If null, the id of the authorized entity is authorizationID.
private boolean
authorized
A flag indicating whether the authentication id is allowed to act on behalf of the authorization id.
private static final long
serialVersionUID
Constructors Summary
public AuthorizeCallback(String authnID, String authzID)
Constructs an instance of AuthorizeCallback.

param
authnID The (authenticated) authentication id.
param
authzID The authorization id.

	authenticationID = authnID;
	authorizationID = authzID;
    
Methods Summary
public java.lang.StringgetAuthenticationID()
Returns the authentication id to check.

return
The authentication id to check.

	return authenticationID;
    
public java.lang.StringgetAuthorizationID()
Returns the authorization id to check.

return
The authentication id to check.

	return authorizationID;
    
public java.lang.StringgetAuthorizedID()
Returns the id of the authorized user.

return
The id of the authorized user. null means the authorization failed.
see
#setAuthorized(boolean)
see
#setAuthorizedID(java.lang.String)

	if (!authorized) {
	    return null;
	}
	return (authorizedID == null) ? authorizationID : authorizedID;
    
public booleanisAuthorized()
Determines whether the authentication id is allowed to act on behalf of the authorization id.

return
true if authorization is allowed; false otherwise
see
#setAuthorized(boolean)
see
#getAuthorizedID()

	return authorized;
    
public voidsetAuthorized(boolean ok)
Sets whether the authorization is allowed.

param
ok true if authorization is allowed; false otherwise
see
#isAuthorized
see
#setAuthorizedID(java.lang.String)

	authorized = ok;
    
public voidsetAuthorizedID(java.lang.String id)
Sets the id of the authorized entity. Called by handler only when the id is different from getAuthorizationID(). For example, the id might need to be canonicalized for the environment in which it will be used.

param
id The id of the authorized user.
see
#setAuthorized(boolean)
see
#getAuthorizedID

	authorizedID = id;