@ConsumerType public interface Provider
Modifier and Type | Method and Description |
---|---|
String |
getAccessTokenPropertyPath(String clientId)
Return the property path where the access token will be stored (if ProviderConfig is has access token storage enabled)
|
Api |
getApi()
Specifies an instance of scribe
Api to use for this provider. |
User |
getCurrentUser(SlingHttpServletRequest request)
Use the request to get the User who has (or will have) oauth profile data attached
|
String |
getDetailsURL()
OAuth provider's user details URL
|
String |
getErrorDescriptionFromValidateTokenResponseBody(String responseBody)
Parse the response body and return the error description contained in the response
|
String[] |
getExtendedDetailsURLs(String scope)
OAuth provider's user extended details URLs, depending on the specific scope
|
String[] |
getExtendedDetailsURLs(String scope,
String userId,
Map<String,Object> props)
OAuth provider's user extended details URLs, depending on the specific scope and previously fetched data
(e.g.
|
String |
getId()
Unique ID for this provider, used to match a ProviderConfig with this Provider
|
String |
getName()
Readable name for this Provider
|
String |
getOAuthIdPropertyPath(String clientId)
Return the property path where the oauth user id will be stored
|
OAuthRequest |
getProtectedDataRequest(String url)
Create an OAuthRequest to request protected data from the OAuth provider system.
|
ProviderType |
getType()
Currently only oauth 1a and oauth 2 are supported.
|
String |
getUserFolderPath(String userId,
String clientId,
Map<String,Object> props)
Return the node path where the user should be created
|
String |
getUserIdFromValidateTokenResponseBody(String responseBody)
Parse the response body and return the userId contained in the response
|
String |
getUserIdProperty()
What is the user data property that contains this OAuth provider's user id? (e.g.
|
String |
getValidateTokenUrl(String clientId,
String token)
OAuth provider validate token URL
|
boolean |
isValidToken(String responseBody,
String clientId,
String tokenType)
Check the validity of a token
|
Map<String,Object> |
mapProperties(String srcUrl,
String clientId,
Map<String,Object> existing,
Map<String,String> newProperties)
Map the provider's user properties name to CQ user properties.
|
String |
mapUserId(String userId,
Map<String,Object> props)
Map the provider's userid to CRX user id; Note that usernames must be unique so
the returned username should always include some prefix specific to this provider
(e.g.
|
void |
onUserCreate(User user)
Called after a user is updated (e.g.
|
void |
onUserUpdate(User user)
Called after a user is created (i.e.
|
Map<String,String> |
parseProfileDataResponse(Response response)
Parse the OAuth Response for protected profile data during profile import
|
ProviderType getType()
ProviderType
Api getApi()
Api
to use for this provider.String getDetailsURL()
String[] getExtendedDetailsURLs(String scope)
String[] getExtendedDetailsURLs(String scope, String userId, Map<String,Object> props)
getDetailsURL()
, getExtendedDetailsURLs(String)
).scope
- allows to specify a list of property names for each scopeuserId
- the userIdprops
- contains the data previously fetched.String getId()
String getName()
String mapUserId(String userId, Map<String,Object> props)
userId
- provider's userIdprops
- map of all provider's properties for this userIdString getUserFolderPath(String userId, String clientId, Map<String,Object> props)
userId
- clientId
- in use when creating this userprops
- map of all provider's properties for this userMap<String,Object> mapProperties(String srcUrl, String clientId, Map<String,Object> existing, Map<String,String> newProperties)
getDetailsURL()
.
If getExtendedDetailsURLs(String)
is not null, this
method will be called for the map of properties fetched from each url.srcUrl
- clientId
- in use to retreive this set of propertiesexisting
- CQ properties that have already been mappednewProperties
- addition provider properties that need to be mappedString getAccessTokenPropertyPath(String clientId)
clientId
- String getOAuthIdPropertyPath(String clientId)
clientId
- User getCurrentUser(SlingHttpServletRequest request)
request
- void onUserCreate(User user)
user
- void onUserUpdate(User user)
user
- OAuthRequest getProtectedDataRequest(String url)
url
- Map<String,String> parseProfileDataResponse(Response response) throws IOException
response
- IOException
String getUserIdProperty()
String getValidateTokenUrl(String clientId, String token)
clientId
- token
- boolean isValidToken(String responseBody, String clientId, String tokenType)
responseBody
- clientId
- String getUserIdFromValidateTokenResponseBody(String responseBody)
responseBody
- String getErrorDescriptionFromValidateTokenResponseBody(String responseBody)
responseBody
- Copyright © 2010 - 2020 Adobe. All Rights Reserved