Interface UserTokenProvider

All Known Implementing Classes:
CachingUserTokenProvider, DirectUserTokenProvider

public interface UserTokenProvider
Provides a validated UserToken for a given UserTokenRequest.

Implementations may obtain the token directly from the Identity Service (DirectUserTokenProvider) or transparently cache previously obtained tokens (CachingUserTokenProvider). The contract from the consumer's point of view is the same: supply a request, receive a validated token, or have an exception thrown if the credentials are not valid (or the IdP is unreachable). Consumers MUST NOT need to know which implementation is wired.

Implementations are expected to be thread-safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    Authenticate the supplied request against the Identity Service (or a local cache thereof) and return the resulting validated user token.
  • Method Details

    • getUserToken

      UserToken getUserToken(UserTokenRequest request)
      Authenticate the supplied request against the Identity Service (or a local cache thereof) and return the resulting validated user token.
      Parameters:
      request - credential pair; never null. Field-level null-validation is enforced by UserTokenRequest so implementations may rely on both components being non-null.
      Returns:
      a validated UserToken
      Throws:
      IdentityServiceFacade.IdentityServiceFacadeException - if the Identity Service rejects the credentials or cannot be reached