Class FacebookTokenAdapter
- java.lang.Object
-
- de.xima.fc.security.token.adapter.FacebookTokenAdapter
-
- All Implemented Interfaces:
ITokenAdapter
public class FacebookTokenAdapter extends Object
Token adapter for Facebook.
-
-
Field Summary
Fields Modifier and Type Field Description static FacebookTokenAdapterINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description protectedFacebookTokenAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessToken(IAuthWebContext authWebContext)StringgetAccessTokenHeader(IClientDescriptor clientDescriptor)StringgetAccessTokenHeaderPrefix(IClientDescriptor clientDescriptor)StringgetIdToken(IAuthWebContext authWebContext)StringgetRefreshToken(IAuthWebContext authWebContext)Optional<org.pac4j.core.profile.UserProfile>getUserProfile(IAuthWebContext authWebContext)Returns the user profile associated with this token adapter.booleanisExpired(org.pac4j.core.profile.UserProfile profile)Optional<org.pac4j.core.profile.UserProfile>renewUserProfile(IAuthWebContext authWebContext)
-
-
-
Field Detail
-
INSTANCE
public static FacebookTokenAdapter INSTANCE
-
-
Method Detail
-
renewUserProfile
public Optional<org.pac4j.core.profile.UserProfile> renewUserProfile(IAuthWebContext authWebContext) throws org.pac4j.core.exception.TechnicalException
- Throws:
org.pac4j.core.exception.TechnicalException
-
getAccessToken
public String getAccessToken(IAuthWebContext authWebContext)
- Returns:
- The access token
-
getRefreshToken
public String getRefreshToken(IAuthWebContext authWebContext)
- Returns:
- The refresh token
-
isExpired
public boolean isExpired(org.pac4j.core.profile.UserProfile profile)
- Specified by:
isExpiredin interfaceITokenAdapter- Returns:
- Whether the access_token of the profile is expired
-
getAccessTokenHeaderPrefix
public String getAccessTokenHeaderPrefix(IClientDescriptor clientDescriptor)
- Specified by:
getAccessTokenHeaderPrefixin interfaceITokenAdapter- Returns:
- The access token header prefix for the given client descriptor.
-
getAccessTokenHeader
public String getAccessTokenHeader(IClientDescriptor clientDescriptor)
- Specified by:
getAccessTokenHeaderin interfaceITokenAdapter- Returns:
- The access token header for the given client descriptor.
-
getIdToken
public String getIdToken(IAuthWebContext authWebContext)
- Specified by:
getIdTokenin interfaceITokenAdapter- Returns:
- The id token query parameter for the given client descriptor.
-
getUserProfile
public Optional<org.pac4j.core.profile.UserProfile> getUserProfile(IAuthWebContext authWebContext)
Description copied from interface:ITokenAdapterReturns the user profile associated with this token adapter.- Specified by:
getUserProfilein interfaceITokenAdapter- Returns:
- An optional containing the user profile if it exists, otherwise empty.
-
-