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 FacebookTokenAdapter
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description protected
FacebookTokenAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAccessToken(IAuthWebContext authWebContext)
String
getAccessTokenHeader(IClientDescriptor clientDescriptor)
String
getAccessTokenHeaderPrefix(IClientDescriptor clientDescriptor)
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)
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:
isExpired
in interfaceITokenAdapter
- Returns:
- Whether the access_token of the profile is expired
-
getAccessTokenHeaderPrefix
public String getAccessTokenHeaderPrefix(IClientDescriptor clientDescriptor)
- Specified by:
getAccessTokenHeaderPrefix
in interfaceITokenAdapter
- Returns:
- The access token header prefix for the given client descriptor.
-
getAccessTokenHeader
public String getAccessTokenHeader(IClientDescriptor clientDescriptor)
- Specified by:
getAccessTokenHeader
in interfaceITokenAdapter
- Returns:
- The access token header for the given client descriptor.
-
getIdToken
public String getIdToken(IAuthWebContext authWebContext)
- Specified by:
getIdToken
in 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:ITokenAdapter
Returns the user profile associated with this token adapter.- Specified by:
getUserProfile
in interfaceITokenAdapter
- Returns:
- An optional containing the user profile if it exists, otherwise empty.
-
-