@ConsumerType public interface Provider
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAccessTokenPropertyPath(java.lang.String clientId)
Return the property path where the access token will be stored (if ProviderConfig is has access token storage enabled)
|
org.scribe.builder.api.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
|
java.lang.String |
getDetailsURL()
OAuth provider's user details URL
|
java.lang.String |
getErrorDescriptionFromValidateTokenResponseBody(java.lang.String responseBody)
Parse the response body and return the error description contained in the response
|
java.lang.String[] |
getExtendedDetailsURLs(java.lang.String scope)
OAuth provider's user extended details URLs, depending on the specific scope
|
java.lang.String[] |
getExtendedDetailsURLs(java.lang.String scope,
java.lang.String userId,
java.util.Map<java.lang.String,java.lang.Object> props)
OAuth provider's user extended details URLs, depending on the specific scope and previously fetched data
(e.g.
|
java.lang.String |
getId()
Unique ID for this provider, used to match a ProviderConfig with this Provider
|
java.lang.String |
getName()
Readable name for this Provider
|
java.lang.String |
getOAuthIdPropertyPath(java.lang.String clientId)
Return the property path where the oauth user id will be stored
|
org.scribe.model.OAuthRequest |
getProtectedDataRequest(java.lang.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.
|
java.lang.String |
getUserFolderPath(java.lang.String userId,
java.lang.String clientId,
java.util.Map<java.lang.String,java.lang.Object> props)
Return the node path where the user should be created
|
java.lang.String |
getUserIdFromValidateTokenResponseBody(java.lang.String responseBody)
Parse the response body and return the userId contained in the response
|
java.lang.String |
getUserIdProperty()
What is the user data property that contains this OAuth provider's user id? (e.g.
|
java.lang.String |
getValidateTokenUrl(java.lang.String clientId,
java.lang.String token)
OAuth provider validate token URL
|
boolean |
isValidToken(java.lang.String responseBody,
java.lang.String clientId,
java.lang.String tokenType)
Check the validity of a token
|
java.util.Map<java.lang.String,java.lang.Object> |
mapProperties(java.lang.String srcUrl,
java.lang.String clientId,
java.util.Map<java.lang.String,java.lang.Object> existing,
java.util.Map<java.lang.String,java.lang.String> newProperties)
Map the provider's user properties name to CQ user properties.
|
java.lang.String |
mapUserId(java.lang.String userId,
java.util.Map<java.lang.String,java.lang.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.
|
java.util.Map<java.lang.String,java.lang.String> |
parseProfileDataResponse(org.scribe.model.Response response)
Parse the OAuth Response for protected profile data during profile import
|
ProviderType getType()
ProviderType
org.scribe.builder.api.Api getApi()
Api
to use for this provider.java.lang.String getDetailsURL()
java.lang.String[] getExtendedDetailsURLs(java.lang.String scope)
java.lang.String[] getExtendedDetailsURLs(java.lang.String scope, java.lang.String userId, java.util.Map<java.lang.String,java.lang.Object> props)
getDetailsURL()
, getExtendedDetailsURLs(String)
).scope
- allows to specify a list of property names for each scopeuserId
- the userIdprops
- contains the data previously fetched.java.lang.String getId()
java.lang.String getName()
java.lang.String mapUserId(java.lang.String userId, java.util.Map<java.lang.String,java.lang.Object> props)
userId
- provider's userIdprops
- map of all provider's properties for this userIdjava.lang.String getUserFolderPath(java.lang.String userId, java.lang.String clientId, java.util.Map<java.lang.String,java.lang.Object> props)
userId
- clientId
- in use when creating this userprops
- map of all provider's properties for this userjava.util.Map<java.lang.String,java.lang.Object> mapProperties(java.lang.String srcUrl, java.lang.String clientId, java.util.Map<java.lang.String,java.lang.Object> existing, java.util.Map<java.lang.String,java.lang.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 mappedjava.lang.String getAccessTokenPropertyPath(java.lang.String clientId)
clientId
- java.lang.String getOAuthIdPropertyPath(java.lang.String clientId)
clientId
- User getCurrentUser(SlingHttpServletRequest request)
request
- void onUserCreate(User user)
user
- void onUserUpdate(User user)
user
- org.scribe.model.OAuthRequest getProtectedDataRequest(java.lang.String url)
url
- java.util.Map<java.lang.String,java.lang.String> parseProfileDataResponse(org.scribe.model.Response response) throws java.io.IOException
response
- java.io.IOException
java.lang.String getUserIdProperty()
java.lang.String getValidateTokenUrl(java.lang.String clientId, java.lang.String token)
clientId
- token
- boolean isValidToken(java.lang.String responseBody, java.lang.String clientId, java.lang.String tokenType)
responseBody
- clientId
- java.lang.String getUserIdFromValidateTokenResponseBody(java.lang.String responseBody)
responseBody
- java.lang.String getErrorDescriptionFromValidateTokenResponseBody(java.lang.String responseBody)
responseBody
- Copyright © 2010 - 2020 Adobe. All Rights Reserved