Interface OpenIDUserAware


public interface OpenIDUserAware
An object that can say something about what user it was derived from. Note that you never have both the user information and the token at the same time, but they contain fairly similar contents.
  • Method Details

    • getOpenIdUser

      Optional<OAuth2User> getOpenIdUser()
      Get the underlying OpenID user information.
      Returns:
      The user info, if known. Pay attention to the attributes.
    • getBearerToken

      Optional<OAuth2AccessToken> getBearerToken()
      Get the underlying OpenID Bearer token.
      Returns:
      The bearer token, if known (probably only if originally used to authenticate).
    • getStringClaim

      default String getStringClaim(String claimName)
      Get a claim/attribute that is a string.
      Parameters:
      claimName - The name of the claim.
      Returns:
      The string.
      Throws:
      IllegalStateException - If getOpenIdUser() doesn't provide anything we can get claims from.
    • getOpenIdSubject

      default String getOpenIdSubject()
      Returns:
      The OpenID subject identifier.
      Throws:
      IllegalStateException - If the object was made without either a user or a token.
    • getOpenIdUserName

      default String getOpenIdUserName()
      Returns:
      The preferred OpenID user name. We don't use this directly as it may clash with other user names.
      Throws:
      IllegalStateException - If the object was made without either a user or a token.
    • getOpenIdName

      default String getOpenIdName()
      Returns:
      The real name of the OpenID user.
      Throws:
      IllegalStateException - If the object was made without either a user or a token.
    • getOpenIdEmail

      default Optional<String> getOpenIdEmail()
      Returns:
      The verified email address of the OpenID user, if available.