Class AuthResult

java.lang.Object
google.registry.request.auth.AuthResult

public abstract class AuthResult extends Object
Results of authentication for a given HTTP request, as emitted by an AuthenticationMechanism.
  • Field Details

    • NOT_AUTHENTICATED

      public static final AuthResult NOT_AUTHENTICATED
      No authentication was made.

      In the authentication step, this means that none of the configured authentication methods were able to authenticate the user. But the authorization settings may be such that it's perfectly fine not to be authenticated. The RequestAuthenticator.authorize(google.registry.request.auth.AuthSettings, jakarta.servlet.http.HttpServletRequest) method returns NOT_AUTHENTICATED in this case, as opposed to absent() if authentication failed and was required. So as a return from an authorization check, this can be treated as a success.

  • Constructor Details

    • AuthResult

      public AuthResult()
  • Method Details

    • authLevel

      public abstract AuthSettings.AuthLevel authLevel()
    • userAuthInfo

      public abstract Optional<UserAuthInfo> userAuthInfo()
      Information about the authenticated user, if there is one.
    • appServiceAccount

      public abstract Optional<String> appServiceAccount()
      Service account email of the authenticated app, if there is one.
    • isAuthenticated

      public boolean isAuthenticated()
    • userIdForLogging

      public String userIdForLogging()
    • createApp

      public static AuthResult createApp(String email)
    • createUser

      public static AuthResult createUser(UserAuthInfo userAuthInfo)