Class ValidateX509Certificate

  • All Implemented Interfaces:
    net.shibboleth.idp.authn.principal.PrincipalSupportingComponent, net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, org.opensaml.profile.action.ProfileAction, Aware, MessageSource, MessageSourceAware, Action

    public class ValidateX509Certificate
    extends net.shibboleth.idp.authn.AbstractValidationAction
    An action that checks for a CertificateContext containing X509Certificate objects, and directly produces an AuthenticationResult based on that identity, after optionally validating the certificate(s) against a TrustEngine.
    Event:
    EventIds.PROCEED_EVENT_ID, AuthnEventIds.INVALID_CREDENTIALS, AuthnEventIds.NO_CREDENTIALS
    Precondition:
    ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null
    Postcondition:
    If AuthenticationContext.getSubcontext(CertificateContext.class) != null, then an AuthenticationResult is saved to the AuthenticationContext on a successful validation. On a failure, the AbstractValidationAction.handleError(ProfileRequestContext, AuthenticationContext, Exception, String) method is called.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private net.shibboleth.idp.authn.context.CertificateContext certContext
      CertificateContext containing the credentials to validate.
      private static String DEFAULT_METRIC_NAME
      Default prefix for metrics.
      private org.slf4j.Logger log
      Class logger.
      private org.opensaml.security.trust.TrustEngine<? super org.opensaml.security.x509.X509Credential> trustEngine
      Optional trust engine to validate certificates against.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doExecute​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
      protected boolean doPreExecute​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
      protected Subject populateSubject​(Subject subject)
      void setTrustEngine​(org.opensaml.security.trust.TrustEngine<? super org.opensaml.security.x509.X509Credential> tm)
      Set a TrustEngine to use.
      • Methods inherited from class net.shibboleth.idp.authn.AbstractValidationAction

        addDefaultPrincipals, buildAuthenticationResult, getClassifiedErrors, getMetricName, getRequesterLookupStrategy, getResponderLookupStrategy, getResultCachingPredicate, getSubject, getSupportedPrincipals, handleError, handleError, handleWarning, recordFailure, recordSuccess, setAddDefaultPrincipals, setClassifiedMessages, setMetricName, setRequesterLookupStrategy, setResponderLookupStrategy, setResultCachingPredicate, setSupportedPrincipals
      • Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction

        doExecute, doPreExecute, setAuthenticationContextLookupStrategy
      • Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction

        doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
      • Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction

        getActivationCondition, setActivationCondition
      • Methods inherited from class org.opensaml.profile.action.AbstractProfileAction

        doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
      • Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent

        destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
      • Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent

        initialize, isInitialized
    • Field Detail

      • DEFAULT_METRIC_NAME

        @Nonnull
        @NotEmpty
        private static final String DEFAULT_METRIC_NAME
        Default prefix for metrics.
        See Also:
        Constant Field Values
      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • trustEngine

        @Nullable
        private org.opensaml.security.trust.TrustEngine<? super org.opensaml.security.x509.X509Credential> trustEngine
        Optional trust engine to validate certificates against.
      • certContext

        @Nullable
        private net.shibboleth.idp.authn.context.CertificateContext certContext
        CertificateContext containing the credentials to validate.
    • Constructor Detail

      • ValidateX509Certificate

        public ValidateX509Certificate()
        Constructor.
    • Method Detail

      • setTrustEngine

        public void setTrustEngine​(@Nullable
                                   org.opensaml.security.trust.TrustEngine<? super org.opensaml.security.x509.X509Credential> tm)
        Set a TrustEngine to use.
        Parameters:
        tm - trust engine to use
      • doPreExecute

        protected boolean doPreExecute​(@Nonnull
                                       org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
                                       @Nonnull
                                       net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
        Overrides:
        doPreExecute in class net.shibboleth.idp.authn.AbstractValidationAction
      • doExecute

        protected void doExecute​(@Nonnull
                                 org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
                                 @Nonnull
                                 net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
        Overrides:
        doExecute in class net.shibboleth.idp.authn.AbstractAuthenticationAction
      • populateSubject

        @Nonnull
        protected Subject populateSubject​(@Nonnull
                                          Subject subject)
        Specified by:
        populateSubject in class net.shibboleth.idp.authn.AbstractValidationAction