org.openid4java.server
public class ServerManager extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
_expireIn
Expiration time (in seconds) for associations.
|
private static org.apache.commons.logging.Log |
_log |
private AssociationSessionType |
_minAssocSessEnc
The lowest encryption level session accepted for association sessions
|
private NonceGenerator |
_nonceGenerator
Nonce generator implementation.
|
private java.lang.String |
_opEndpointUrl
The OpenID Provider's endpoint URL, where it accepts OpenID
authentication requests.
|
private AssociationSessionType |
_prefAssocSessEnc
The preferred association session type; will be attempted first.
|
private ServerAssociationStore |
_privateAssociations
Keeps track of private (internal) associations created for signing
authentication responses for stateless consumer sites.
|
private RealmVerifier |
_realmVerifier
Used to perform verify realms against return_to URLs.
|
private ServerAssociationStore |
_sharedAssociations
Keeps track of the associations established with consumer sites.
|
private java.lang.String[] |
_signExtensions
Array of extension namespace URIs that the consumer manager will sign,
if present in auth responses.
|
private java.lang.String |
_signFields
List of coma-separated fields to be signed in authentication responses.
|
private java.lang.String |
_userSetupUrl
In OpenID 1.x compatibility mode, the URL at the OpenID Provider where
the user should be directed when a immediate authentication request
fails.
|
private static boolean |
DEBUG |
Constructor and Description |
---|
ServerManager()
Constructs a ServerManager with default settings.
|
ServerManager(RealmVerifierFactory factory) |
Modifier and Type | Method and Description |
---|---|
Message |
associationResponse(ParameterList requestParams)
Processes a Association Request and returns a Association Response
message, according to the request parameters and the preferences
configured for the OpenID Provider
|
Message |
authResponse(AuthRequest authReq,
java.lang.String userSelId,
java.lang.String userSelClaimed,
boolean authenticatedAndApproved)
Processes a Authentication Request received from a consumer site.
|
Message |
authResponse(AuthRequest authReq,
java.lang.String userSelId,
java.lang.String userSelClaimed,
boolean authenticatedAndApproved,
boolean signNow)
Processes a Authentication Request received from a consumer site.
|
Message |
authResponse(AuthRequest auhtReq,
java.lang.String userSelId,
java.lang.String userSelClaimed,
boolean authenticatedAndApproved,
java.lang.String opEndpoint)
Processes a Authentication Request received from a consumer site.
|
Message |
authResponse(AuthRequest authReq,
java.lang.String userSelId,
java.lang.String userSelClaimed,
boolean authenticatedAndApproved,
java.lang.String opEndpoint,
boolean signNow)
Processes a Authentication Request received from a consumer site.
|
Message |
authResponse(ParameterList requestParams,
java.lang.String userSelId,
java.lang.String userSelClaimed,
boolean authenticatedAndApproved)
Processes a Authentication Request received from a consumer site.
|
Message |
authResponse(ParameterList requestParams,
java.lang.String userSelId,
java.lang.String userSelClaimed,
boolean authenticatedAndApproved,
boolean signNow)
Processes a Authentication Request received from a consumer site.
|
Message |
authResponse(ParameterList requestParams,
java.lang.String userSelId,
java.lang.String userSelClaimed,
boolean authenticatedAndApproved,
java.lang.String opEndpoint)
Processes a Authentication Request received from a consumer site.
|
Message |
authResponse(ParameterList requestParams,
java.lang.String userSelId,
java.lang.String userSelClaimed,
boolean authenticatedAndApproved,
java.lang.String opEndpoint,
boolean signNow)
Processes a Authentication Request received from a consumer site,
after parsing the request parameters into a valid AuthRequest.
|
boolean |
getEnforceRpId()
Gets the flag that instructs the realm verifier to enforce validation
of the return URL agains the endpoints discovered from the RP's realm.
|
int |
getExpireIn()
Gets the expiration time (in seconds) for the generated associations
|
AssociationSessionType |
getMinAssocSessEnc()
Gets the minimum level of encryption configured for association sessions.
|
NonceGenerator |
getNonceGenerator()
Gets the NonceGenerator used for generating nonce tokens to uniquely
identify authentication responses.
|
java.lang.String |
getOPEndpointUrl()
Gets OpenID Provider's endpoint URL, where it accepts OpenID
authentication requests.
|
AssociationSessionType |
getPrefAssocSessEnc()
Gets the preferred association / session type.
|
ServerAssociationStore |
getPrivateAssociations()
Gets the store implementation used for keeping track of the generated
private associations (used for signing responses to stateless consumer
sites).
|
RealmVerifier |
getRealmVerifier()
Gets the RealmVerifier used to verify realms against return_to URLs.
|
ServerAssociationStore |
getSharedAssociations()
Gets the store implementation used for keeping track of the generated
associations established with consumer sites.
|
java.lang.String[] |
getSignExtensions() |
java.lang.String |
getSignFields()
Gets the list of parameters that the OpenID Provider will sign when
generating authentication responses.
|
java.lang.String |
getUserSetupUrl()
Gets the URL at the OpenID Provider where the user should be directed
when a immediate authentication request fails.
|
void |
setEnforceRpId(boolean enforceRpId)
Sets the flag that instructs the realm verifier to enforce validation
of the return URL agains the endpoints discovered from the RP's realm.
|
void |
setExpireIn(int _expireIn)
Sets the expiration time (in seconds) for the generated associations
|
void |
setMinAssocSessEnc(AssociationSessionType minAssocSessEnc)
Configures the minimum level of encryption accepted for association
sessions.
|
void |
setNonceGenerator(NonceGenerator nonceGenerator)
Sets the NonceGenerator implementation that will be used to generate
nonce tokens to uniquely identify authentication responses.
|
void |
setOPEndpointUrl(java.lang.String opEndpointUrl)
Sets the OpenID Provider's endpoint URL, where it accepts OpenID
authentication requests.
|
void |
setPrefAssocSessEnc(AssociationSessionType type)
Sets the preferred association / session type.
|
void |
setPrivateAssociations(ServerAssociationStore privateAssociations)
Sets the store implementation that will be used for keeping track of
the generated private associations (used for signing responses to
stateless consumer sites).
|
void |
setRealmVerifier(RealmVerifier realmVerifier)
Sets the RealmVerifier used to verify realms against return_to URLs.
|
void |
setSharedAssociations(ServerAssociationStore sharedAssociations)
Sets the store implementation that will be used for keeping track of
the generated associations established with consumer sites.
|
void |
setSignExtensions(java.lang.String[] extensins) |
void |
setSignFields(java.lang.String signFields)
Sets the list of parameters that the OpenID Provider will sign when
generating authentication responses.
|
void |
setUserSetupUrl(java.lang.String userSetupUrl)
Sets the URL at the OpenID Provider where the user should be directed
when a immediate authentication request fails.
|
void |
sign(AuthSuccess authSuccess)
Signs an AuthSuccess message, using the association identified by the
handle specified within the message.
|
Message |
verify(ParameterList requestParams)
Responds to a verification request from the consumer.
|
private static org.apache.commons.logging.Log _log
private static final boolean DEBUG
private ServerAssociationStore _sharedAssociations
private ServerAssociationStore _privateAssociations
private NonceGenerator _nonceGenerator
private AssociationSessionType _minAssocSessEnc
private AssociationSessionType _prefAssocSessEnc
private int _expireIn
private java.lang.String _userSetupUrl
MUST be configured in order for the OpenID provider to be able to respond correctly with AuthImmediateFailure messages in compatibility mode.
private java.lang.String _signFields
private java.lang.String[] _signExtensions
private RealmVerifier _realmVerifier
private java.lang.String _opEndpointUrl
This is a global setting for the ServerManager; can also be set on a per message basis.
public ServerManager()
@Inject public ServerManager(RealmVerifierFactory factory)
public ServerAssociationStore getSharedAssociations()
ServerAssociationStore
public void setSharedAssociations(ServerAssociationStore sharedAssociations)
sharedAssociations
- ServerAssociationStore implementationServerAssociationStore
public ServerAssociationStore getPrivateAssociations()
ServerAssociationStore
public void setPrivateAssociations(ServerAssociationStore privateAssociations)
privateAssociations
- ServerAssociationStore implementationServerAssociationStore
public AssociationSessionType getMinAssocSessEnc()
Default: no-encryption session, SHA1 MAC association
public NonceGenerator getNonceGenerator()
NonceGenerator
public void setNonceGenerator(NonceGenerator nonceGenerator)
NonceGenerator
public void setMinAssocSessEnc(AssociationSessionType minAssocSessEnc)
Default: no-encryption session, SHA1 MAC association
public AssociationSessionType getPrefAssocSessEnc()
public void setPrefAssocSessEnc(AssociationSessionType type) throws ServerException
ServerException
AssociationSessionType
public int getExpireIn()
public void setExpireIn(int _expireIn)
public java.lang.String getUserSetupUrl()
public void setUserSetupUrl(java.lang.String userSetupUrl)
public void setSignFields(java.lang.String signFields)
The fields in the list must be coma-separated and must not include the 'openid.' prefix. Fields that are required to be signed are automatically added by the underlying logic, so that a valid message is generated, regardles if they are included in the user-supplied list or not.
public java.lang.String getSignFields()
Coma-separated list.
public void setSignExtensions(java.lang.String[] extensins)
public java.lang.String[] getSignExtensions()
public RealmVerifier getRealmVerifier()
public void setRealmVerifier(RealmVerifier realmVerifier)
public boolean getEnforceRpId()
public void setEnforceRpId(boolean enforceRpId)
public java.lang.String getOPEndpointUrl()
This is a global setting for the ServerManager; can also be set on a per message basis.
public void setOPEndpointUrl(java.lang.String opEndpointUrl)
This is a global setting for the ServerManager; can also be set on a per message basis.
public Message associationResponse(ParameterList requestParams)
public Message authResponse(ParameterList requestParams, java.lang.String userSelId, java.lang.String userSelClaimed, boolean authenticatedAndApproved)
Uses ServerManager's global OpenID Provider endpoint URL.
authResponse(org.openid4java.message.ParameterList, String, String,
boolean, String, boolean)
public Message authResponse(AuthRequest authReq, java.lang.String userSelId, java.lang.String userSelClaimed, boolean authenticatedAndApproved)
Uses ServerManager's global OpenID Provider endpoint URL.
authResponse(org.openid4java.message.AuthRequest, String, String,
boolean, String, boolean)
public Message authResponse(ParameterList requestParams, java.lang.String userSelId, java.lang.String userSelClaimed, boolean authenticatedAndApproved, boolean signNow)
Uses ServerManager's global OpenID Provider endpoint URL.
authResponse(org.openid4java.message.ParameterList, String, String,
boolean, String, boolean)
public Message authResponse(AuthRequest authReq, java.lang.String userSelId, java.lang.String userSelClaimed, boolean authenticatedAndApproved, boolean signNow)
Uses ServerManager's global OpenID Provider endpoint URL.
authResponse(org.openid4java.message.AuthRequest, String, String,
boolean, String, boolean)
public Message authResponse(ParameterList requestParams, java.lang.String userSelId, java.lang.String userSelClaimed, boolean authenticatedAndApproved, java.lang.String opEndpoint)
authResponse(org.openid4java.message.ParameterList, String, String,
boolean, String, boolean)
public Message authResponse(AuthRequest auhtReq, java.lang.String userSelId, java.lang.String userSelClaimed, boolean authenticatedAndApproved, java.lang.String opEndpoint)
authResponse(org.openid4java.message.AuthRequest, String, String,
boolean, String, boolean)
public Message authResponse(ParameterList requestParams, java.lang.String userSelId, java.lang.String userSelClaimed, boolean authenticatedAndApproved, java.lang.String opEndpoint, boolean signNow)
authResponse(org.openid4java.message.AuthRequest, String, String,
boolean, String, boolean)
public Message authResponse(AuthRequest authReq, java.lang.String userSelId, java.lang.String userSelClaimed, boolean authenticatedAndApproved, java.lang.String opEndpoint, boolean signNow)
opEndpoint
- The endpoint URL where the OP accepts OpenID
authentication requests.authReq
- A valid authentication request.userSelId
- OP-specific Identifier selected by the user at
the OpenID Provider; if present it will override
the one received in the authentication request.userSelClaimed
- Claimed Identifier selected by the user at
the OpenID Provider; if present it will override
the one received in the authentication request.authenticatedAndApproved
- Flag indicating that the OP has
authenticated the user and the user
has approved the authentication
transactionsignNow
- If true, the returned AuthSuccess will be signed.
If false, the signature will not be computed and
set - this will have to be performed later,
using #sign(org.openid4java.message.Message).public void sign(AuthSuccess authSuccess) throws ServerException, AssociationException
authSuccess
- The Authentication Success message to be signed.ServerException
- If the Association corresponding to the handle
in the @authSuccess cannot be retrieved from
the store.AssociationException
- If the signature cannot be computed.public Message verify(ParameterList requestParams)
requestParams
- ParameterList containing the parameters received
in a verification request from a consumer site.Copyright 2006-2008 Sxip Identity Corporation