public class SPFormAuthenticationMechanism extends ServletFormAuthenticationMechanism
ServletFormAuthenticationMechanism.Factory
AuthenticationMechanism.AuthenticationMechanismOutcome, AuthenticationMechanism.ChallengeResult
FACTORY, SAVE_ORIGINAL_REQUEST
DEFAULT_POST_LOCATION, LOCATION_ATTRIBUTE
Constructor and Description |
---|
SPFormAuthenticationMechanism(FormParserFactory parserFactory,
String name,
String loginPage,
String errorPage,
ServletContext servletContext,
PicketLinkType configuration,
PicketLinkAuditHelper auditHelper) |
SPFormAuthenticationMechanism(FormParserFactory parserFactory,
String name,
String loginPage,
String errorPage,
ServletContext servletContext,
SAMLConfigurationProvider configProvider,
PicketLinkAuditHelper auditHelper) |
handleRedirectBack, servePage, storeInitialLocation, storeInitialLocation
runFormAuth
public static final String INITIAL_LOCATION_STORED
protected transient String samlHandlerChainClass
protected final ServletContext servletContext
protected SAMLConfigurationProvider configProvider
SAMLConfigurationProvider
protected transient X509Certificate idpCertificate
protected int timerInterval
protected Timer timer
public static final String EMPTY_PASSWORD
protected boolean enableAudit
public static final String FORM_ACCOUNT_NOTE
public static final String FORM_REQUEST_NOTE
protected transient SAML2HandlerChain chain
protected SPType spConfiguration
protected PicketLinkType configuration
protected String serviceURL
protected String identityURL
protected String issuerID
protected String configFile
protected boolean saveRestoreRequest
protected Lock chainLock
protected String canonicalizationMethod
protected PicketLinkAuditHelper auditHelper
protected TrustKeyManager keyManager
protected IDPSSODescriptorType idpMetadata
protected FormParserFactory formParserFactory
public SPFormAuthenticationMechanism(FormParserFactory parserFactory, String name, String loginPage, String errorPage, ServletContext servletContext, PicketLinkType configuration, PicketLinkAuditHelper auditHelper)
public SPFormAuthenticationMechanism(FormParserFactory parserFactory, String name, String loginPage, String errorPage, ServletContext servletContext, SAMLConfigurationProvider configProvider, PicketLinkAuditHelper auditHelper) throws ProcessingException
ProcessingException
protected String getDefaultEncoding(ServletContext servletContext)
public AuthenticationMechanism.ChallengeResult sendChallenge(HttpServerExchange exchange, SecurityContext securityContext)
AuthenticationMechanism
The individual mechanisms should update the response headers and body of the message as appropriate however they should
not set the response code, instead that should be indicated in the AuthenticationMechanism.ChallengeResult
and the most appropriate
overall response code will be selected.
This method should not return null
.
sendChallenge
in interface AuthenticationMechanism
sendChallenge
in class FormAuthenticationMechanism
exchange
- The exchangesecurityContext
- The security contextAuthenticationMechanism.ChallengeResult
indicating if a challenge was sent and the desired response code.public AuthenticationMechanism.AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, SecurityContext securityContext)
AuthenticationMechanism
authenticate
in interface AuthenticationMechanism
authenticate
in class FormAuthenticationMechanism
exchange
- The exchangeprotected HttpServletRequestWrapper bufferServletRequestInputStream(HttpServletRequest originalRequest, byte[] bytes)
protected AuthenticationMechanism.AuthenticationMechanismOutcome handleSAMLResponse(HttpServerExchange exchange, SecurityContext securityContext) throws IOException
IOException
protected AuthenticationMechanism.ChallengeResult generalUserRequest(HttpServerExchange httpServerExchange, SecurityContext securityContext) throws IOException
httpServerExchange
- securityContext
- IOException
protected boolean matchRequest(HttpServletRequest request)
protected void register(SecurityContext securityContext, Account account)
protected AuthenticationMechanism.AuthenticationMechanismOutcome localAuthentication(HttpServerExchange httpServerExchange, SecurityContext securityContext) throws IOException
httpServerExchange
- securityContext
- IOException
protected AuthenticationMechanism.AuthenticationMechanismOutcome handleSAMLRequest(HttpServerExchange httpServerExchange, SecurityContext securityContext) throws IOException
httpServerExchange
- securityContext
- IOException
protected AuthenticationMechanism.AuthenticationMechanismOutcome handleSAML2Response(HttpServerExchange httpServerExchange, SecurityContext securityContext) throws IOException
httpServerExchange
- securityContext
- IOException
protected boolean isHttpPostBinding()
Indicates if the SP is configure with HTTP POST Binding.
protected boolean sessionIsValid(HttpSession session)
protected String savedRequestURL(HttpSession session)
protected void startPicketLink()
protected void initKeyProvider(ServletContext context)
Initialize the KeyProvider configurations. This configurations are to be used during signing and validation of SAML assertions.
context
- protected boolean doSupportSignature()
Indicates if digital signatures/validation of SAML assertions are enabled. Subclasses that supports signature should override this method.
protected void processConfiguration()
protected void reloadConfiguration()
protected void processIdPMetadata(SPType spConfiguration)
protected IDPSSODescriptorType getIdpMetadataFromProvider(SPType spConfiguration)
protected IDPSSODescriptorType getIdpMetadataFromFile(SPType configuration)
protected IDPSSODescriptorType handleMetadata(EntitiesDescriptorType entities)
protected IDPSSODescriptorType getIDPSSODescriptor(EntitiesDescriptorType entities)
protected IDPSSODescriptorType handleMetadata(EntityDescriptorType entityDescriptor)
protected void initializeHandlerChain() throws ConfigurationException, ProcessingException
protected void populateChainConfig() throws ConfigurationException, ProcessingException
protected boolean isGlobalLogout(HttpServletRequest request)
protected String getSAMLVersion(HttpServletRequest request)
protected Document toSAMLResponseDocument(String samlResponse, boolean isPostBinding) throws ParsingException
ParsingException
public AuthenticationMechanism.AuthenticationMechanismOutcome handleSAML11UnsolicitedResponse(HttpServletRequest request, HttpServletResponse response, SecurityContext securityContext)
public void audit(PicketLinkAuditEvent event)
protected boolean isAjaxRequest(HttpServletRequest request)
public String getIdentityURL()
Copyright © 2019 JBoss by Red Hat. All rights reserved.