javax.security.sasl
Class AuthorizeCallback

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.security.sasl.AuthorizeCallback
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Callback sample code for javax.security.auth.callback.Callback definition code for javax.security.auth.callback.Callback

public class AuthorizeCallback
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Callback sample code for javax.security.auth.callback.Callback definition code for javax.security.auth.callback.Callback , Serializable sample code for java.io.Serializable definition code for java.io.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
See Also:
Serialized Form

Constructor Summary
AuthorizeCallback sample code for javax.security.sasl.AuthorizeCallback.AuthorizeCallback(java.lang.String, java.lang.String) definition code for javax.security.sasl.AuthorizeCallback.AuthorizeCallback(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  authnID, String sample code for java.lang.String definition code for java.lang.String  authzID)
          Constructs an instance of AuthorizeCallback.
 
Method Summary
 String sample code for java.lang.String definition code for java.lang.String getAuthenticationID sample code for javax.security.sasl.AuthorizeCallback.getAuthenticationID() definition code for javax.security.sasl.AuthorizeCallback.getAuthenticationID() ()
          Returns the authentication id to check.
 String sample code for java.lang.String definition code for java.lang.String getAuthorizationID sample code for javax.security.sasl.AuthorizeCallback.getAuthorizationID() definition code for javax.security.sasl.AuthorizeCallback.getAuthorizationID() ()
          Returns the authorization id to check.
 String sample code for java.lang.String definition code for java.lang.String getAuthorizedID sample code for javax.security.sasl.AuthorizeCallback.getAuthorizedID() definition code for javax.security.sasl.AuthorizeCallback.getAuthorizedID() ()
          Returns the id of the authorized user.
 boolean isAuthorized sample code for javax.security.sasl.AuthorizeCallback.isAuthorized() definition code for javax.security.sasl.AuthorizeCallback.isAuthorized() ()
          Determines whether the authentication id is allowed to act on behalf of the authorization id.
 void setAuthorized sample code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean) definition code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean) (boolean ok)
          Sets whether the authorization is allowed.
 void setAuthorizedID sample code for javax.security.sasl.AuthorizeCallback.setAuthorizedID(java.lang.String) definition code for javax.security.sasl.AuthorizeCallback.setAuthorizedID(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  id)
          Sets the id of the authorized entity.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

AuthorizeCallback sample code for javax.security.sasl.AuthorizeCallback(java.lang.String, java.lang.String) definition code for javax.security.sasl.AuthorizeCallback(java.lang.String, java.lang.String)

public AuthorizeCallback(String sample code for java.lang.String definition code for java.lang.String  authnID,
                         String sample code for java.lang.String definition code for java.lang.String  authzID)
Constructs an instance of AuthorizeCallback.

Parameters:
authnID - The (authenticated) authentication id.
authzID - The authorization id.
Method Detail

getAuthenticationID sample code for javax.security.sasl.AuthorizeCallback.getAuthenticationID() definition code for javax.security.sasl.AuthorizeCallback.getAuthenticationID()

public String sample code for java.lang.String definition code for java.lang.String  getAuthenticationID()
Returns the authentication id to check.

Returns:
The authentication id to check.

getAuthorizationID sample code for javax.security.sasl.AuthorizeCallback.getAuthorizationID() definition code for javax.security.sasl.AuthorizeCallback.getAuthorizationID()

public String sample code for java.lang.String definition code for java.lang.String  getAuthorizationID()
Returns the authorization id to check.

Returns:
The authentication id to check.

isAuthorized sample code for javax.security.sasl.AuthorizeCallback.isAuthorized() definition code for javax.security.sasl.AuthorizeCallback.isAuthorized()

public boolean isAuthorized()
Determines whether the authentication id is allowed to act on behalf of the authorization id.

Returns:
true if authorization is allowed; false otherwise
See Also:
setAuthorized(boolean) sample code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean) definition code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean) , getAuthorizedID() sample code for javax.security.sasl.AuthorizeCallback.getAuthorizedID() definition code for javax.security.sasl.AuthorizeCallback.getAuthorizedID()

setAuthorized sample code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean) definition code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean)

public void setAuthorized(boolean ok)
Sets whether the authorization is allowed.

Parameters:
ok - true if authorization is allowed; false otherwise
See Also:
isAuthorized() sample code for javax.security.sasl.AuthorizeCallback.isAuthorized() definition code for javax.security.sasl.AuthorizeCallback.isAuthorized() , setAuthorizedID(java.lang.String) sample code for javax.security.sasl.AuthorizeCallback.setAuthorizedID(java.lang.String) definition code for javax.security.sasl.AuthorizeCallback.setAuthorizedID(java.lang.String)

getAuthorizedID sample code for javax.security.sasl.AuthorizeCallback.getAuthorizedID() definition code for javax.security.sasl.AuthorizeCallback.getAuthorizedID()

public String sample code for java.lang.String definition code for java.lang.String  getAuthorizedID()
Returns the id of the authorized user.

Returns:
The id of the authorized user. null means the authorization failed.
See Also:
setAuthorized(boolean) sample code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean) definition code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean) , setAuthorizedID(java.lang.String) sample code for javax.security.sasl.AuthorizeCallback.setAuthorizedID(java.lang.String) definition code for javax.security.sasl.AuthorizeCallback.setAuthorizedID(java.lang.String)

setAuthorizedID sample code for javax.security.sasl.AuthorizeCallback.setAuthorizedID(java.lang.String) definition code for javax.security.sasl.AuthorizeCallback.setAuthorizedID(java.lang.String)

public void setAuthorizedID(String sample code for java.lang.String definition code for 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.

Parameters:
id - The id of the authorized user.
See Also:
setAuthorized(boolean) sample code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean) definition code for javax.security.sasl.AuthorizeCallback.setAuthorized(boolean) , getAuthorizedID() sample code for javax.security.sasl.AuthorizeCallback.getAuthorizedID() definition code for javax.security.sasl.AuthorizeCallback.getAuthorizedID()