public class OAuth2ClientCredentialsOperation extends Object
| Constructor and Description |
|---|
OAuth2ClientCredentialsOperation() |
| Modifier and Type | Method and Description |
|---|---|
OAuth2ClientCredentialsRequest |
getAccessToken()
Creates a request to get a Token for the given audience using the 'Client Credentials' grant.
|
public OAuth2ClientCredentialsRequest getAccessToken()
AuthAPI auth = new AuthenticationAPI("B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
try {
TokenHolder result = auth.requestToken("https://topups.reloadly.com").execute();
} catch (APIException e) {
//api error
} catch (ReloadlyException e) {
// request error
} catch (Exception e) {
// all other errors
}
Copyright © 2021. All rights reserved.