public final class AuthorizationClientHelper extends Object
SampleAuthorizationClient
for an example usage.Modifier and Type | Class and Description |
---|---|
static class |
AuthorizationClientHelper.Builder
Helps in the creation of an instance of AuthorizationClientHelper.
|
Modifier and Type | Method and Description |
---|---|
AccessToken |
getAccessToken()
Authenticates the client with the Authorization Service, obtains an access token and returns it.
|
AccessToken |
getAccessToken(List<String> scopes)
Authenticates the client with the Authorization Service, obtains an access token and returns it; the client can request for specific
scopes during authentication by using the "scopes" parameter.
|
AccessToken |
getAccessTokenForUser(javax.servlet.ServletRequest servletRequest)
Authenticates the client (along with the user's auth code) with the Authorization Service, obtains an access token and returns it.
|
AccessToken |
getAccessTokenForUser(String userName,
String userPassword)
Authenticates the client and the end user with the Authorization Service, obtains an access token and returns it.
|
AccessToken |
getAccessTokenForUser(String userName,
String userPassword,
List<String> scopes)
Authenticates the client and the end user with the Authorization Service, obtains an access token and returns it; the client can
request for specific scopes during authentication by using the "scopes" parameter.
|
TokenAggregate |
getTokenAggregate()
Authenticates the client with the Authorization Service and obtains a token aggregate.
|
TokenAggregate |
getTokenAggregate(List<String> scopes)
Authenticates the client with the Authorization Service, obtains a token aggregate and returns it; the client can request for
specific scopes during authentication by using the "scopes" parameter.
|
TokenAggregate |
getTokenAggregate(String refreshToken)
Authenticates the client with the Authorization Service, obtains a token aggregate using a refresh token and returns it.
|
TokenAggregate |
getTokenAggregateForUser(javax.servlet.ServletRequest servletRequest)
Authenticates the client (along with the user's auth code) with the Authorization Service, obtains a token aggregate and returns it.
|
TokenAggregate |
getTokenAggregateForUser(String userName,
String userPassword)
Authenticates the client and the end user with the Authorization Service, obtains a token aggregate and returns it.
|
TokenAggregate |
getTokenAggregateForUser(String userName,
String userPassword,
List<String> scopes)
Authenticates the client and the end user with the Authorization Service, obtains an access token and returns it; the client can
request for specific scopes during authentication by using the "scopes" parameter.
|
void |
shutdown()
Shuts down the helper library and releases any system resources associated with it.
|
public AccessToken getAccessToken() throws AuthorizationHelperException, HttpResponseException
AccessToken
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public TokenAggregate getTokenAggregate() throws AuthorizationHelperException, HttpResponseException
TokenAggregate
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public AccessToken getAccessToken(List<String> scopes) throws AuthorizationHelperException, HttpResponseException
scopes
- The list of scopes the client wants to specify while making the token request.AccessToken
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public TokenAggregate getTokenAggregate(List<String> scopes) throws AuthorizationHelperException, HttpResponseException
scopes
- The list of scopes the client wants to specify while making the token request.TokenAggregate
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public AccessToken getAccessTokenForUser(javax.servlet.ServletRequest servletRequest) throws AuthorizationHelperException, HttpResponseException
servletRequest
- The request which the application received.AccessToken
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public TokenAggregate getTokenAggregateForUser(javax.servlet.ServletRequest servletRequest) throws AuthorizationHelperException, HttpResponseException
servletRequest
- This used to construct the Redirection URI which will be validated by the Authorization Service to ensure that the
redirection URI sent in auth code request and redirection URI in access token request are identical.TokenAggregate
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public AccessToken getAccessTokenForUser(String userName, String userPassword) throws AuthorizationHelperException, HttpResponseException
userName
- The user name for whom the token is being requested.userPassword
- The user's password.AccessToken
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public TokenAggregate getTokenAggregateForUser(String userName, String userPassword) throws AuthorizationHelperException, HttpResponseException
userName
- The user name for whom the token is being requested.userPassword
- The user's password.TokenAggregate
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public AccessToken getAccessTokenForUser(String userName, String userPassword, List<String> scopes) throws AuthorizationHelperException, HttpResponseException
userName
- The user name for whom the token is being requested.userPassword
- The user's password.scopes
- The list of scopes the client wants to specify while making the token request.AccessToken
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public TokenAggregate getTokenAggregateForUser(String userName, String userPassword, List<String> scopes) throws AuthorizationHelperException, HttpResponseException
userName
- The user name for whom the token is being requested.userPassword
- The user's password.scopes
- The list of scopes the client wants to specify while making the token request.AccessToken
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public TokenAggregate getTokenAggregate(String refreshToken) throws AuthorizationHelperException, HttpResponseException
refreshToken
- A refresh token obtained previously by the client.TokenAggregate
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.HttpResponseException
- Indicates HTTP error responses propagated by the Authorization Helper APIs.public void shutdown() throws AuthorizationHelperException
AuthorizationHelperException
- Indicates error conditions in the Authorization Helper APIs.Copyright © 2023 Avaya. All rights reserved.