Interface TokenStateManager

  • All Known Implementing Classes:
    DefaultTokenStateManager

    public interface TokenStateManager
    Authorization Code Flow Token State Manager. It converts the ID, access and refresh tokens returned in the authorization code grant response into a token state for OIDC Code AuthenticationMechanism to keep it as a session cookie. For example, default TokenStateManager concatenates all 3 tokens into a single String but does not persist it. Custom TokenStateManager may choose to keep the tokens in the external storage (DB, file system, etc.) and return a reference to this storage.
    • Method Detail

      • createTokenState

        io.smallrye.mutiny.Uni<String> createTokenState​(io.vertx.ext.web.RoutingContext routingContext,
                                                        OidcTenantConfig oidcConfig,
                                                        AuthorizationCodeTokens tokens,
                                                        OidcRequestContext<String> requestContext)
        Convert the authorization code flow tokens into a token state.
        Parameters:
        routingContext - the request context
        oidcConfig - the tenant configuration
        tokens - the authorization code flow tokens
        requestContext - the request context
        Returns:
        the token state
      • getTokens

        io.smallrye.mutiny.Uni<AuthorizationCodeTokens> getTokens​(io.vertx.ext.web.RoutingContext routingContext,
                                                                  OidcTenantConfig oidcConfig,
                                                                  String tokenState,
                                                                  OidcRequestContext<AuthorizationCodeTokens> requestContext)
        Convert the token state into the authorization code flow tokens.
        Parameters:
        routingContext - the request context
        oidcConfig - the tenant configuration
        tokenState - the token state
        requestContext - the request context
        Returns:
        the authorization code flow tokens
      • deleteTokens

        io.smallrye.mutiny.Uni<Void> deleteTokens​(io.vertx.ext.web.RoutingContext routingContext,
                                                  OidcTenantConfig oidcConfig,
                                                  String tokenState,
                                                  OidcRequestContext<Void> requestContext)
        Delete the token state.
        Parameters:
        routingContext - the request context
        oidcConfig - the tenant configuration
        tokenState - the token state