public class Auth extends Object
| Constructor and Description |
|---|
Auth()
Initializes the SP SAML instance.
|
Auth(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes the SP SAML instance.
|
Auth(Saml2Settings settings,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes the SP SAML instance.
|
Auth(String filename)
Initializes the SP SAML instance.
|
Auth(String filename,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes the SP SAML instance.
|
| Modifier and Type | Method and Description |
|---|---|
String |
buildRequestSignature(String samlRequest,
String relayState,
String signAlgorithm)
Generates the Signature for a SAML Request
|
String |
buildResponseSignature(String samlResponse,
String relayState,
String signAlgorithm)
Generates the Signature for a SAML Response
|
Collection<String> |
getAttribute(String name) |
Map<String,List<String>> |
getAttributes() |
List<String> |
getAttributesName() |
List<String> |
getErrors() |
String |
getLastAssertionId() |
List<org.joda.time.Instant> |
getLastAssertionNotOnOrAfter() |
String |
getLastErrorReason() |
String |
getLastMessageId() |
String |
getLastRequestId() |
String |
getLastRequestXML()
Returns the most recently-constructed/processed
XML SAML request (AuthNRequest, LogoutRequest)
|
String |
getLastResponseXML()
Returns the most recently-constructed/processed
XML SAML response (SAMLResponse, LogoutResponse).
|
String |
getNameId() |
org.joda.time.DateTime |
getSessionExpiration() |
String |
getSessionIndex() |
Saml2Settings |
getSettings() |
String |
getSLOResponseUrl() |
String |
getSLOurl() |
String |
getSSOurl() |
boolean |
isAuthenticated() |
Boolean |
isDebugActive() |
void |
login()
Initiates the SSO process.
|
void |
login(String returnTo)
Initiates the SSO process.
|
void |
login(String returnTo,
Boolean forceAuthn,
Boolean isPassive,
Boolean setNameIdPolicy)
Initiates the SSO process.
|
String |
login(String returnTo,
Boolean forceAuthn,
Boolean isPassive,
Boolean setNameIdPolicy,
Boolean stay)
Initiates the SSO process.
|
void |
logout()
Initiates the SLO process.
|
void |
logout(String returnTo)
Initiates the SLO process.
|
void |
logout(String returnTo,
String nameId,
String sessionIndex)
Initiates the SLO process.
|
String |
logout(String returnTo,
String nameId,
String sessionIndex,
Boolean stay)
Initiates the SLO process.
|
void |
processResponse()
Process the SAML Response sent by the IdP.
|
void |
processResponse(String requestId)
Process the SAML Response sent by the IdP.
|
void |
processSLO()
Process the SAML Logout Response / Logout Request sent by the IdP.
|
void |
processSLO(Boolean keepLocalSession,
String requestId)
Process the SAML Logout Response / Logout Request sent by the IdP.
|
void |
setStrict(Boolean value)
Set the strict mode active/disable
|
public Auth()
throws IOException,
SettingsException,
Error
IOExceptionSettingsExceptionErrorpublic Auth(String filename) throws IOException, SettingsException, Error
filename - String Filename with the settingsIOExceptionSettingsExceptionErrorpublic Auth(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException,
SettingsException,
Error
request - HttpServletRequest object to be processedresponse - HttpServletResponse object to be usedIOExceptionSettingsExceptionErrorpublic Auth(String filename, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SettingsException, IOException, Error
filename - String Filename with the settingsrequest - HttpServletRequest object to be processedresponse - HttpServletResponse object to be usedSettingsExceptionIOExceptionErrorpublic Auth(Saml2Settings settings, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SettingsException
settings - Saml2Settings object. Setting datarequest - HttpServletRequest object to be processedresponse - HttpServletResponse object to be usedSettingsExceptionpublic void setStrict(Boolean value)
value - Strict valuepublic String login(String returnTo, Boolean forceAuthn, Boolean isPassive, Boolean setNameIdPolicy, Boolean stay) throws IOException, SettingsException
returnTo - The target URL the user should be returned to after login (relayState).
Will be a self-routed URL when null, or not be appended at all when an empty string is providedforceAuthn - When true the AuthNRequest will set the ForceAuthn='true'isPassive - When true the AuthNRequest will set the IsPassive='true'setNameIdPolicy - When true the AuthNRequest will set a nameIdPolicystay - True if we want to stay (returns the url string) False to execute redirectionIOExceptionSettingsExceptionpublic void login(String returnTo, Boolean forceAuthn, Boolean isPassive, Boolean setNameIdPolicy) throws IOException, SettingsException
returnTo - The target URL the user should be returned to after login (relayState).
Will be a self-routed URL when null, or not be appended at all when an empty string is providedforceAuthn - When true the AuthNRequest will set the ForceAuthn='true'isPassive - When true the AuthNRequest will set the IsPassive='true'setNameIdPolicy - When true the AuthNRequest will set a nameIdPolicyIOExceptionSettingsExceptionpublic void login()
throws IOException,
SettingsException
IOExceptionSettingsExceptionpublic void login(String returnTo) throws IOException, SettingsException
returnTo - The target URL the user should be returned to after login (relayState).
Will be a self-routed URL when null, or not be appended at all when an empty string is provided.IOExceptionSettingsExceptionpublic String logout(String returnTo, String nameId, String sessionIndex, Boolean stay) throws IOException, XMLEntityException, SettingsException
returnTo - The target URL the user should be returned to after logout (relayState).
Will be a self-routed URL when null, or not be appended at all when an empty string is providednameId - The NameID that will be set in the LogoutRequest.sessionIndex - The SessionIndex (taken from the SAML Response in the SSO process).stay - True if we want to stay (returns the url string) False to execute redirectionIOExceptionXMLEntityExceptionSettingsExceptionpublic void logout(String returnTo, String nameId, String sessionIndex) throws IOException, XMLEntityException, SettingsException
returnTo - The target URL the user should be returned to after logout (relayState).
Will be a self-routed URL when null, or not be appended at all when an empty string is providednameId - The NameID that will be set in the LogoutRequest.sessionIndex - The SessionIndex (taken from the SAML Response in the SSO process).IOExceptionXMLEntityExceptionSettingsExceptionpublic void logout()
throws IOException,
XMLEntityException,
SettingsException
public void logout(String returnTo) throws IOException, XMLEntityException, SettingsException
returnTo - The target URL the user should be returned to after logout (relayState).
Will be a self-routed URL when null, or not be appended at all when an empty string is providedIOExceptionXMLEntityExceptionSettingsExceptionpublic String getSSOurl()
public String getSLOurl()
public String getSLOResponseUrl()
public void processResponse(String requestId) throws Exception
requestId - The ID of the AuthNRequest sent by this SP to the IdPExceptionpublic void processResponse()
throws Exception
Exceptionpublic void processSLO(Boolean keepLocalSession, String requestId) throws Exception
keepLocalSession - When false will destroy the local session, otherwise will destroy itrequestId - The ID of the LogoutRequest sent by this SP to the IdPExceptionpublic void processSLO()
throws Exception
Exceptionpublic final boolean isAuthenticated()
public final List<String> getAttributesName()
public final Map<String,List<String>> getAttributes()
public final Collection<String> getAttribute(String name)
name - Name of the attributepublic final String getNameId()
public final String getSessionIndex()
public final org.joda.time.DateTime getSessionExpiration()
public String getLastMessageId()
public String getLastAssertionId()
public List<org.joda.time.Instant> getLastAssertionNotOnOrAfter()
public List<String> getErrors()
public String getLastErrorReason()
public String getLastRequestId()
public Saml2Settings getSettings()
public Boolean isDebugActive()
public String buildRequestSignature(String samlRequest, String relayState, String signAlgorithm) throws SettingsException
samlRequest - The SAML RequestrelayState - The RelayStatesignAlgorithm - Signature algorithm methodSettingsExceptionpublic String buildResponseSignature(String samlResponse, String relayState, String signAlgorithm) throws SettingsException
samlResponse - The SAML ResponserelayState - The RelayStatesignAlgorithm - Signature algorithm methodSettingsExceptionpublic String getLastRequestXML()
public String getLastResponseXML()
Copyright © 2017. All rights reserved.