Class SSOTokenContext

  • All Implemented Interfaces:
    SubjectContext, org.forgerock.services.context.Context
    Direct Known Subclasses:
    AdminSubjectContext

    public class SSOTokenContext
    extends org.forgerock.services.context.AbstractContext
    implements SubjectContext
    CREST context that provides a convenience method for getting hold of the caller as an authenticated subject based on the OpenAM SSO Token associated with the request.
    Since:
    12.0.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  SSOTokenContext.Factory
      Guice factory for SSOTokenContext instances
    • Field Summary

      • Fields inherited from class org.forgerock.services.context.AbstractContext

        data
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        SSOTokenContext​(Debug debug, SessionCache sessionCache, org.forgerock.services.context.Context parent)
      Construct a new SSOTokenContext from the parent, which is expected to contain a SecurityContext.
      protected SSOTokenContext​(Debug debug, SessionCache sessionCache, org.forgerock.services.context.Context parent, com.google.common.base.Supplier<SSOToken> token)
      Construct a new SSOTokenContext using a supplier for the SSOToken instance.
    • Constructor Detail

      • SSOTokenContext

        protected SSOTokenContext​(Debug debug,
                                  SessionCache sessionCache,
                                  org.forgerock.services.context.Context parent,
                                  com.google.common.base.Supplier<SSOToken> token)
        Construct a new SSOTokenContext using a supplier for the SSOToken instance.
        Parameters:
        debug - the debug logger used by this context
        sessionCache - the session cache used to look up the session for the caller
        parent - The parent context.
        token - A supplier for the SSOToken to derive the other attributes of this context from.
      • SSOTokenContext

        @Inject
        public SSOTokenContext​(Debug debug,
                               SessionCache sessionCache,
                               org.forgerock.services.context.Context parent)
        Construct a new SSOTokenContext from the parent, which is expected to contain a SecurityContext.
        Parameters:
        parent - The parent context.
    • Method Detail

      • getSsoToken

        public static SSOToken getSsoToken​(org.forgerock.services.context.Context context)
                                    throws SSOException
        Obtain an SSOToken from a Context.
        Parameters:
        context - The context. Must contain a SecurityContext.
        Returns:
        The SSOToken.
        Throws:
        SSOException - If the token could not be obtained.
      • getCallerSubject

        public Subject getCallerSubject()
        Description copied from interface: SubjectContext
        Returns the authenticated subject associated with this request.
        Specified by:
        getCallerSubject in interface SubjectContext
        Returns:
        the authenticated subject associated with this request, or null if not authenticated.