Interface CredentialsProvider

  • All Known Implementing Classes:
    DefaultCredentialsProvider

    public interface CredentialsProvider
    Provides user credentials based on an authentication token
    • Method Detail

      • credentials

        Optional<User> credentials​(UUID authenticationToken)
                            throws CredentialsException
        Performs an authentication lookup, using the default registry port (1099).
        Parameters:
        authenticationToken - the authentication token
        Returns:
        the User credentials associated with the authenticationToken, an empty Optional if the user credentials were not found or have expired
        Throws:
        CredentialsException - in case of an exception while fetching credentials, such as no credentials provider found
      • authenticationToken

        static Optional<UUID> authenticationToken​(String[] args)
        Finds and returns an authentication token in the given String array
        Parameters:
        args - the argument array
        Returns:
        the authentication token or an empty Optional if none is found
        See Also:
        AUTHENTICATION_TOKEN_PREFIX
      • isAuthenticationToken

        static boolean isAuthenticationToken​(String argument)
        Parameters:
        argument - the argument
        Returns:
        true if argument is an authentication token ('authenticationToken:123-123-123-123')
      • parseAuthenticationToken

        static UUID parseAuthenticationToken​(String argument)
        Parameters:
        argument - an argument containing an authenticationToken
        Returns:
        the UUID parsed from the given argument