public interface OAuth2Client
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAccessToken()
Gets an access token for an instance of OAuth2 client
It retrieves a valid existing token, if available
or obtains one using the token endpoint details provided in authProfilePage
|
java.lang.String |
getAccessToken(java.lang.String aAuthCode)
Gets an access token using the given authorization code
|
ClipboardPage |
getAccessTokenFromEndpoint()
Deprecated.
|
java.lang.String |
getAuthorizeURL(java.lang.String aGadgetID)
Generate authorization URL to initiate Authorization Code flow.
|
java.lang.String |
getFreshAccessToken()
Purges the access token and invokes access token endpoint
|
java.lang.Object |
getHttpRequestUpdatedWithAccessToken(java.util.Map<java.lang.String,java.lang.Object> map)
Deprecated.
|
boolean |
hasTokenExpired(ClipboardPage tokenPage)
verifies if the token is expired
|
java.lang.String |
invokeUserInfoEndpoint(java.lang.String userInfoEndpoint,
java.lang.String oauth2Token) |
boolean |
isAccessTokenPresent()
Will retrieve access token, possibly performing refresh operation and update cache.
|
boolean |
isAccessTokenPresentForAnyUser()
Check if access token is present for given client id, scope and grant type.
|
ClipboardPage |
retrieveAccessToken()
Gets an access token for an instance of OAuth2 client
It retrieves a valid existing token, if available
or obtains one using the token endpoint details provided in authProfilePage
|
java.util.Map<java.lang.String,java.lang.String> |
revokeToken()
revoke the access token for a given client id , client secret and scope
Tries to delete the access token from the provider and then from pega
|
java.util.Map<java.lang.String,java.lang.String> |
revokeTokensForAllUsers()
revoke the access tokens for a given client id , client secret and scope
Tries to delete all the access tokens for all users from the provider and then from pega.
|
boolean |
updateHttpRequestWithAccessToken(java.lang.Object aHttpRequest,
boolean aGetFresh)
Updates HTTPRequest object with the access token.
|
boolean |
updateHttpRequestWithAccessToken(java.lang.Object aHttpReqObj,
boolean aGetFresh,
java.lang.String aAccessToken) |
java.lang.String getAccessToken()
PRRuntimeException
- if encounters any problem while getting the tokenjava.lang.String getAccessToken(java.lang.String aAuthCode)
aAuthCode
- PRRuntimeException
- if encounters any problem while getting the tokenClipboardPage retrieveAccessToken() throws java.lang.Exception
java.lang.Exception
@Deprecated ClipboardPage getAccessTokenFromEndpoint() throws java.lang.Exception
java.lang.Exception
- if encounters any problem while getting the tokenjava.util.Map<java.lang.String,java.lang.String> revokeToken()
java.util.Map<java.lang.String,java.lang.String> revokeTokensForAllUsers()
boolean hasTokenExpired(ClipboardPage tokenPage)
tokenPage
- java.lang.String getFreshAccessToken()
@Deprecated java.lang.Object getHttpRequestUpdatedWithAccessToken(java.util.Map<java.lang.String,java.lang.Object> map)
map
- map comprising HttpUriRequest, URI and accesstokenboolean updateHttpRequestWithAccessToken(java.lang.Object aHttpRequest, boolean aGetFresh)
aHttpRequest
- PegaRESTClient implementation to set access tokenaGetFresh
- Attempt to retrieve a fresh access tokenboolean isAccessTokenPresent()
boolean isAccessTokenPresentForAnyUser()
java.lang.String getAuthorizeURL(java.lang.String aGadgetID)
aGadgetID
- Used to restart UI flow from where it left off when access token is received.boolean updateHttpRequestWithAccessToken(java.lang.Object aHttpReqObj, boolean aGetFresh, java.lang.String aAccessToken)
java.lang.String invokeUserInfoEndpoint(java.lang.String userInfoEndpoint, java.lang.String oauth2Token) throws java.lang.Exception
java.lang.Exception
Copyright © 2018 Pegasystems Inc. All Rights Reserved.