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 |
getLastRequestId() |
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
IOExceptionSettingsExceptionpublic Auth(String filename) throws IOException, SettingsException
filename - String Filename with the settingsIOExceptionSettingsExceptionpublic Auth(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException,
SettingsException
request - HttpServletRequest object to be processedresponse - HttpServletResponse object to be usedIOExceptionSettingsExceptionpublic Auth(String filename, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SettingsException, IOException
filename - String Filename with the settingsrequest - HttpServletRequest object to be processedresponse - HttpServletResponse object to be usedSettingsExceptionIOExceptionpublic 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
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 redirectionIOExceptionpublic void login(String returnTo, Boolean forceAuthn, Boolean isPassive, Boolean setNameIdPolicy) throws IOException
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 nameIdPolicyIOExceptionpublic void login()
throws IOException
IOExceptionpublic void login(String returnTo) throws IOException
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.IOExceptionpublic String logout(String returnTo, String nameId, String sessionIndex, Boolean stay) throws IOException, XMLEntityException
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 redirectionIOExceptionXMLEntityExceptionpublic void logout(String returnTo, String nameId, String sessionIndex) throws IOException, XMLEntityException
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).IOExceptionXMLEntityExceptionpublic void logout()
throws IOException,
XMLEntityException
IOExceptionXMLEntityExceptionpublic void logout(String returnTo) throws IOException, XMLEntityException
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 providedIOExceptionXMLEntityExceptionpublic 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 XMLEntityException, XPathExpressionException, IOException
keepLocalSession - When false will destroy the local session, otherwise will destroy itrequestId - The ID of the LogoutRequest sent by this SP to the IdPXMLEntityExceptionXPathExpressionExceptionIOExceptionpublic void processSLO()
throws XPathExpressionException,
XMLEntityException,
IOException
public 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 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)
samlRequest - The SAML RequestrelayState - The RelayStatesignAlgorithm - Signature algorithm methodpublic String buildResponseSignature(String samlResponse, String relayState, String signAlgorithm)
samlResponse - The SAML ResponserelayState - The RelayStatesignAlgorithm - Signature algorithm methodCopyright © 2016. All rights reserved.