Class SilverpeasWebTokenService


  • @Technical
    @Bean
    @Singleton
    public class SilverpeasWebTokenService
    extends Object
    This service allows generating several WEB tokens per identifier.

    An identifier represents any kind of resource (Service, entity, etc.).

    This allows a service to identify use token to identify resources without using the real identifiers.

    Generated tokens MUST be cleared by the service which creating them.

    Author:
    silveryocha
    • Constructor Detail

      • SilverpeasWebTokenService

        public SilverpeasWebTokenService()
    • Method Detail

      • consumeIdentifierBy

        public Optional<String> consumeIdentifierBy​(String tokenValue)
        Gets the identifier behind the given token value.
        Parameters:
        tokenValue - a token value.
        Returns:
        an optional string representing the identifier behind the token.
      • revokeById

        public void revokeById​(String id)
        Removes all generated token for an identifier.
        Parameters:
        id - any identifier.