Class AddGrantTypeToClientMetadata

    • Field Detail

      • log

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

        @Nonnull
        private Predicate<ProfileRequestContext> authorizationCodeFlowPredicate
        Predicate used to indicate whether authorization code flow is enabled.
      • implicitFlowPredicate

        @Nonnull
        private Predicate<ProfileRequestContext> implicitFlowPredicate
        Predicate used to indicate whether implicit flow is enabled.
      • refreshTokensPredicate

        @Nonnull
        private Predicate<ProfileRequestContext> refreshTokensPredicate
        Predicate used to indicate whether refresh tokens are enabled.
      • supportedGrantTypes

        @Nonnull
        private Map<com.nimbusds.oauth2.sdk.GrantType,​Predicate<ProfileRequestContext>> supportedGrantTypes
        Map of supported grant types and their corresponding predicates.
    • Constructor Detail

      • AddGrantTypeToClientMetadata

        public AddGrantTypeToClientMetadata()
        Constructor.
    • Method Detail

      • getAuthorizationCodeFlowEnabled

        public Predicate<ProfileRequestContext> getAuthorizationCodeFlowEnabled()
        Get predicate used to indicate whether authorization code flow is enabled.
        Returns:
        Predicate used to indicate whether authorization code flow is enabled.
      • setAuthorizationCodeFlowEnabled

        public void setAuthorizationCodeFlowEnabled​(Predicate<ProfileRequestContext> predicate)
        Set predicate used to indicate whether authorization code flow is enabled.
        Parameters:
        predicate - What to set.
      • getImplicitFlowEnabled

        public Predicate<ProfileRequestContext> getImplicitFlowEnabled()
        Get predicate used to indicate whether hybrid flow is enabled.
        Returns:
        Predicate used to indicate whether hybrid flow is enabled.
      • setImplicitFlowEnabled

        public void setImplicitFlowEnabled​(Predicate<ProfileRequestContext> predicate)
        Set predicate used to indicate whether hybrid flow is enabled.
        Parameters:
        predicate - What to set.
      • getRefreshTokensEnabled

        public Predicate<ProfileRequestContext> getRefreshTokensEnabled()
        Get predicate used to indicate whether refresh tokens are enabled.
        Returns:
        Predicate used to indicate whether refresh tokens are enabled.
      • setRefreshTokensEnabled

        public void setRefreshTokensEnabled​(Predicate<ProfileRequestContext> predicate)
        Set predicate used to indicate whether refresh tokens are enabled.
        Parameters:
        predicate - What to set.
      • addGrantTypeIfEnabled

        protected void addGrantTypeIfEnabled​(Set<com.nimbusds.oauth2.sdk.GrantType> resultTypes,
                                             com.nimbusds.oauth2.sdk.GrantType grantType,
                                             Predicate<ProfileRequestContext> predicate,
                                             ProfileRequestContext profileRequestContext)
        Adds a given grant type to the given set of grant types, if the given predicate is true.
        Parameters:
        resultTypes - The result set where the grant type is potentially added.
        grantType - The grant type to check.
        predicate - The predicate used for checking.
        profileRequestContext - The profile context used as an input for the predicate.