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 TypeMethodDescriptiongetUserToken(UserTokenRequest request) Authenticate the supplied request against the Identity Service (or a local cache thereof) and return the resulting validated user token.
-
Method Details
-
getUserToken
Authenticate the supplied request against the Identity Service (or a local cache thereof) and return the resulting validated user token.- Parameters:
request- credential pair; nevernull. Field-level null-validation is enforced byUserTokenRequestso 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
-