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 Summary
Modifier and Type Method Description Optional<OAuth2AccessToken>
getBearerToken()
Get the underlying OpenID Bearer token.default Optional<String>
getOpenIdEmail()
default String
getOpenIdName()
default String
getOpenIdSubject()
Optional<OAuth2User>
getOpenIdUser()
Get the underlying OpenID user information.default String
getOpenIdUserName()
default String
getStringClaim(String claimName)
Get a claim/attribute that is a string.
-
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
Get a claim/attribute that is a string.- Parameters:
claimName
- The name of the claim.- Returns:
- The string.
- Throws:
IllegalStateException
- IfgetOpenIdUser()
doesn't provide anything we can get claims from.
-
getOpenIdSubject
- Returns:
- The OpenID subject identifier.
- Throws:
IllegalStateException
- If the object was made without either a user or a token.
-
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
- Returns:
- The real name of the OpenID user.
- Throws:
IllegalStateException
- If the object was made without either a user or a token.
-
getOpenIdEmail
- Returns:
- The verified email address of the OpenID user, if available.
-