Interface ITokenAdapter
-
- All Known Implementing Classes:
FacebookTokenAdapter
public interface ITokenAdapter
Interface for token adapters.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getAccessToken(IAuthWebContext authWebContext)
String
getAccessTokenHeader(IClientDescriptor clientDescriptor)
String
getAccessTokenHeaderPrefix(IClientDescriptor clientDescriptor)
static Optional<ITokenAdapter>
getByProfile(Optional<org.pac4j.core.profile.UserProfile> profile)
String
getIdToken(IAuthWebContext authWebContext)
String
getRefreshToken(IAuthWebContext authWebContext)
Optional<org.pac4j.core.profile.UserProfile>
getUserProfile(IAuthWebContext authWebContext)
Returns the user profile associated with this token adapter.boolean
isExpired(org.pac4j.core.profile.UserProfile profile)
-
-
-
Method Detail
-
getAccessTokenHeaderPrefix
String getAccessTokenHeaderPrefix(IClientDescriptor clientDescriptor)
- Returns:
- The access token header prefix for the given client descriptor.
-
getAccessTokenHeader
String getAccessTokenHeader(IClientDescriptor clientDescriptor)
- Returns:
- The access token header for the given client descriptor.
-
getAccessToken
String getAccessToken(IAuthWebContext authWebContext)
- Returns:
- The access token
-
getRefreshToken
String getRefreshToken(IAuthWebContext authWebContext)
- Returns:
- The refresh token
-
getIdToken
String getIdToken(IAuthWebContext authWebContext)
- Returns:
- The id token query parameter for the given client descriptor.
-
isExpired
boolean isExpired(org.pac4j.core.profile.UserProfile profile)
- Returns:
- Whether the access_token of the profile is expired
-
getUserProfile
Optional<org.pac4j.core.profile.UserProfile> getUserProfile(IAuthWebContext authWebContext)
Returns the user profile associated with this token adapter.- Returns:
- An optional containing the user profile if it exists, otherwise empty.
-
getByProfile
static Optional<ITokenAdapter> getByProfile(Optional<org.pac4j.core.profile.UserProfile> profile)
-
-