public class AuthenticationServer extends Object implements MOAIDAuthConstants
AuthenticationSession is stored in a session store and retrieved
by giving the session ID.DEBUG_OUTPUT_HIERARCHY, DEFAULT_BKU, DEFAULT_BKU_HTTPS, GET_MIS_SESSIONID, HEADER_CACHE_CONTROL, HEADER_EXPIRES, HEADER_PRAGMA, HEADER_VALUE_CACHE_CONTROL, HEADER_VALUE_CACHE_CONTROL_IE, HEADER_VALUE_EXPIRES, HEADER_VALUE_PRAGMA, IDENTITY_LINK_SIGNER_OID, IDENTITY_LINK_SIGNER_OID_NUMBER, IDENTITY_LINK_SIGNERS_WITHOUT_OID, PARAM_BKU, PARAM_BKUTEMPLATE, PARAM_INPUT_PROCESSOR_SIGN_TEMPLATE, PARAM_OA, PARAM_RETURN, PARAM_SAMLARTIFACT, PARAM_SESSIONID, PARAM_SOURCEID, PARAM_TARGET, PARAM_TEMPLATE, PARAM_USEMANDATE, PARAM_XMLRESPONSE, PARTY_ORGAN_REPRESENTATION_OID_NUMBER, PARTY_REPRESENTATION_OID_NUMBER, REQ_GET_FOREIGN_ID, REQ_PROCESS_VALIDATOR_INPUT, REQ_START_AUTHENTICATION, REQ_VERIFY_AUTH_BLOCK, REQ_VERIFY_CERTIFICATE, REQ_VERIFY_IDENTITY_LINK| Constructor and Description |
|---|
AuthenticationServer()
Constructor for AuthenticationServer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Cleans up expired session and authentication data stores.
|
String |
createXMLSignatureRequestForeignID(String sessionID,
iaik.x509.X509Certificate cert)
Returns an CreateXMLSignatureRequest for signing the ERnP statement.
|
AuthenticationData |
getAuthenticationData(String samlArtifact)
Retrieves
AuthenticationData indexed by the SAML artifact. |
iaik.x509.X509Certificate |
getCertificate(String sessionID,
Map readInfoboxResponseParameters)
Processes an
<CreateXMLSignatureResponse> sent by the
security layer implementation. |
String |
getCreateXMLSignatureRequestAuthBlockOrRedirect(AuthenticationSession session,
AuthConfigurationProvider authConf,
OAAuthParameter oaParam) |
String |
getCreateXMLSignatureRequestForeigID(AuthenticationSession session,
AuthConfigurationProvider authConf,
OAAuthParameter oaParam,
iaik.x509.X509Certificate cert) |
String |
getForeignAuthenticationData(String sessionID)
Gets the foreign authentication data.
|
static AuthenticationServer |
getInstance()
Returns the single instance of
AuthenticationServer. |
static AuthenticationSession |
getSession(String id)
Retrieves a session from the session store.
|
static void |
processInput(AuthenticationSession session,
Map parameters)
Intermediate processing of the infoboxes.
|
String |
selectBKU(String authURL,
String target,
String oaURL,
String bkuSelectionTemplateURL,
String templateURL)
Processes request to select a BKU.
|
void |
setSecondsAuthDataTimeOut(long seconds)
Sets the authDataTimeOut.
|
void |
setSecondsSessionTimeOut(long seconds)
Sets the sessionTimeOut.
|
String |
startAuthentication(String authURL,
String target,
String targetFriendlyName,
String oaURL,
String templateURL,
String bkuURL,
String useMandate,
String sessionID,
String scheme,
String sourceID)
Processes the beginning of an authentication session.
|
String |
verifyAuthenticationBlock(String sessionID,
String xmlCreateXMLSignatureReadResponse)
Processes a
<CreateXMLSignatureResponse> sent by the
security layer implementation. |
String |
verifyAuthenticationBlockMandate(String sessionID,
Element mandate)
Processes a
<CreateXMLSignatureResponse> sent by the
security layer implementation. |
String |
verifyIdentityLink(String sessionID,
Map infoboxReadResponseParameters)
Processes an
<InfoboxReadResponse> sent by the
security layer implementation. |
void |
verifyMandate(String sessionID,
MISMandate mandate)
Processes an
Mandate sent by the
MIS. |
iaik.x509.X509Certificate |
verifyXMLSignature(String sessionID,
Map createXMLSignatureResponseParameters)
Processes an
<CreateXMLSignatureResponse> sent by the
security layer implementation. |
public AuthenticationServer()
public static AuthenticationServer getInstance()
AuthenticationServer.AuthenticationServerpublic String selectBKU(String authURL, String target, String oaURL, String bkuSelectionTemplateURL, String templateURL) throws WrongParametersException, AuthenticationException, ConfigurationException, BuildException
AuthConfigurationProvider.getBKUSelectionType().
bkuSelectionType==HTMLComplete, a returnURI for the
"BKU Auswahl" service is returned.
bkuSelectionType==HTMLSelect, an HTML form for BKU selection is returned.authURL - base URL of MOA-ID Auth componenttarget - "Geschäftsbereich"oaURL - online application URL requestedbkuSelectionTemplateURL - template for BKU selection form to be used
in case of HTMLSelect; may be nulltemplateURL - URL providing an HTML template for the HTML form to be used
for call startAuthenticationbkuSelectionType==HTMLComplete, the returnURI for the
"BKU Auswahl" service;
for bkuSelectionType==HTMLSelect, an HTML form for BKU selectionWrongParametersException - upon missing parametersAuthenticationException - when the configured BKU selection service cannot be reached,
and when the given bkuSelectionTemplateURL cannot be reachedConfigurationException - on missing configuration dataBuildException - while building the HTML formpublic String startAuthentication(String authURL, String target, String targetFriendlyName, String oaURL, String templateURL, String bkuURL, String useMandate, String sessionID, String scheme, String sourceID) throws WrongParametersException, AuthenticationException, ConfigurationException, BuildException
<InfoboxReadRequest><InfoboxReadRequest>authURL - URL of the servlet to be used as data URLtarget - "Geschäftsbereich" of the online application requestedtargetFriendlyName - Friendly name of the target if the target is configured via configurationoaURL - online application URL requestedbkuURL - URL of the "Bürgerkartenumgebung" to be used;
may be null; in this case, the default location will be useduseMandate - Indicates if mandate is used or nottemplateURL - URL providing an HTML template for the HTML form generatedtemplateMandteURL - URL providing an HTML template for the HTML form generated (for signing in mandates mode)scheme - determines the protocol usedsourceID - AuthenticationExceptionWrongParametersExceptionConfigurationExceptionBuildExceptionGetIdentityLinkFormBuilder,
InfoboxReadRequestBuilderpublic String verifyIdentityLink(String sessionID, Map infoboxReadResponseParameters) throws AuthenticationException, BuildException, ParseException, ConfigurationException, ValidateException, ServiceException
<InfoboxReadResponse> sent by the
security layer implementation.<InfoboxReadResponse><InfoboxReadResponse><CreateXMLSignatureRequest>
containg the authentication block, meant to be returned to the
security layer implementationsessionID - ID of associated authentication session datainfoboxReadResponseParameters - The parameters from the response returned from
the BKU including the <InfoboxReadResponse><CreateXMLSignatureRequest>AuthenticationExceptionBuildExceptionParseExceptionConfigurationExceptionValidateExceptionServiceExceptionpublic void verifyMandate(String sessionID, MISMandate mandate) throws AuthenticationException, BuildException, ParseException, ConfigurationException, ValidateException, ServiceException
Mandate sent by the
MIS.Mandate<CreateXMLSignatureRequest>
containg the authentication block, meant to be returned to the
security layer implementationsessionID - ID of associated authentication session datainfoboxReadResponseParameters - The parameters from the response returned from
the BKU including the <InfoboxReadResponse>AuthenticationExceptionBuildExceptionParseExceptionConfigurationExceptionValidateExceptionServiceExceptionpublic String getCreateXMLSignatureRequestAuthBlockOrRedirect(AuthenticationSession session, AuthConfigurationProvider authConf, OAAuthParameter oaParam) throws ConfigurationException, BuildException, ValidateException
session - authConf - oaParam - ConfigurationExceptionBuildExceptionValidateExceptionpublic String createXMLSignatureRequestForeignID(String sessionID, iaik.x509.X509Certificate cert) throws AuthenticationException, BuildException, ParseException, ConfigurationException, ValidateException, ServiceException
sessionID - ID of associated authentication session datacert - The certificate from the user<CreateXMLSignatureRequest>AuthenticationExceptionBuildExceptionParseExceptionConfigurationExceptionValidateExceptionServiceExceptionpublic String getCreateXMLSignatureRequestForeigID(AuthenticationSession session, AuthConfigurationProvider authConf, OAAuthParameter oaParam, iaik.x509.X509Certificate cert) throws ConfigurationException
ConfigurationExceptionpublic iaik.x509.X509Certificate verifyXMLSignature(String sessionID, Map createXMLSignatureResponseParameters) throws AuthenticationException, BuildException, ParseException, ConfigurationException, ValidateException, ServiceException
<CreateXMLSignatureResponse> sent by the
security layer implementation.<CreateXMLSignatureResponse><CreateXMLSignatureResponse>sessionID - ID of associated authentication session datacreateXMLSignatureResponseParameters - The parameters from the response returned from
the BKU including the <CreateXMLSignatureResponse>AuthenticationExceptionBuildExceptionParseExceptionConfigurationExceptionValidateExceptionServiceExceptionpublic iaik.x509.X509Certificate getCertificate(String sessionID, Map readInfoboxResponseParameters) throws AuthenticationException, BuildException, ParseException, ConfigurationException, ValidateException, ServiceException
<CreateXMLSignatureResponse> sent by the
security layer implementation.<CreateXMLSignatureResponse><CreateXMLSignatureResponse>sessionID - ID of associated authentication session datareadInfoboxResponseParameters - The parameters from the response returned from
the BKU including the <ReadInfoboxResponse>AuthenticationExceptionBuildExceptionParseExceptionConfigurationExceptionValidateExceptionServiceExceptionpublic static void processInput(AuthenticationSession session, Map parameters) throws ValidateException
session - The current authentication sessionparameters - The parameters got returned by the user input fieldsValidateExceptionpublic String verifyAuthenticationBlock(String sessionID, String xmlCreateXMLSignatureReadResponse) throws AuthenticationException, BuildException, ParseException, ConfigurationException, ServiceException, ValidateException
<CreateXMLSignatureResponse> sent by the
security layer implementation.<CreateXMLSignatureResponse><CreateXMLSignatureResponse> for error codes<CreateXMLSignatureResponse>sessionID - session ID of the running authentication sessionxmlCreateXMLSignatureReadResponse - String representation of the
<CreateXMLSignatureResponse>AuthenticationExceptionBuildExceptionParseExceptionConfigurationExceptionServiceExceptionValidateExceptionpublic String verifyAuthenticationBlockMandate(String sessionID, Element mandate) throws AuthenticationException, BuildException, ParseException, ConfigurationException, ServiceException, ValidateException
<CreateXMLSignatureResponse> sent by the
security layer implementation.<CreateXMLSignatureResponse><CreateXMLSignatureResponse> for error codes<CreateXMLSignatureResponse>sessionID - session ID of the running authentication sessionxmlCreateXMLSignatureReadResponse - String representation of the
<CreateXMLSignatureResponse>AuthenticationExceptionBuildExceptionParseExceptionConfigurationExceptionServiceExceptionValidateExceptionpublic String getForeignAuthenticationData(String sessionID) throws AuthenticationException, BuildException, ParseException, ConfigurationException, ServiceException, ValidateException
sessionID - session ID of the running authentication sessionAuthenticationExceptionBuildExceptionParseExceptionConfigurationExceptionServiceExceptionValidateExceptionpublic AuthenticationData getAuthenticationData(String samlArtifact) throws AuthenticationException
AuthenticationData indexed by the SAML artifact.
The AuthenticationData is deleted from the store upon end of this call.AuthenticationDataAuthenticationExceptionpublic static AuthenticationSession getSession(String id) throws AuthenticationException
id - session IDAuthenticationSession stored with given session ID,
null if session ID unknownAuthenticationExceptionpublic void cleanup()
public void setSecondsSessionTimeOut(long seconds)
seconds - Time out of the session in secondspublic void setSecondsAuthDataTimeOut(long seconds)
seconds - Time out for signing AuthData in secondsCopyright © 2016. All Rights Reserved.