Package google.registry.request.auth
Class RequestAuthenticator
java.lang.Object
google.registry.request.auth.RequestAuthenticator
Top-level authentication/authorization class; calls authentication mechanisms as needed.
-
Constructor Summary
ConstructorDescriptionRequestAuthenticator
(com.google.common.collect.ImmutableList<AuthenticationMechanism> apiAuthenticationMechanisms) -
Method Summary
Modifier and TypeMethodDescriptionauthorize
(AuthSettings auth, jakarta.servlet.http.HttpServletRequest req) Attempts to authenticate and authorize the user, according to the settings of the action.
-
Constructor Details
-
RequestAuthenticator
@Inject public RequestAuthenticator(com.google.common.collect.ImmutableList<AuthenticationMechanism> apiAuthenticationMechanisms)
-
-
Method Details
-
authorize
public Optional<AuthResult> authorize(AuthSettings auth, jakarta.servlet.http.HttpServletRequest req) Attempts to authenticate and authorize the user, according to the settings of the action.- Parameters:
auth
- the auth settings of the action, which determine what authentication and authorization are allowedreq
- theHttpServletRequest
; some authentication mechanisms use HTTP headers- Returns:
- an authentication result if authentication/authorization was successful, or absent() if not; authentication can be "successful" even without any authentication if the action's auth settings are set to NONE -- in this case, NOT_AUTHENTICATED is returned
-