public class TokenCredentials extends Object implements ServiceClientCredentials
| Modifier and Type | Field and Description |
|---|---|
protected String |
scheme
The authentication scheme.
|
protected String |
token
The secure token.
|
| Constructor and Description |
|---|
TokenCredentials(String scheme,
String token)
Initializes a new instance of the TokenCredentials.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyCredentialsFilter(okhttp3.OkHttpClient.Builder clientBuilder)
Apply the credentials to the HTTP client builder.
|
String |
getScheme()
Get the authentication scheme.
|
String |
getToken()
Get the secure token.
|
void |
refreshToken()
Refresh the secure token.
|
void |
setToken(String token)
Set the secure token.
|
protected String scheme
protected String token
public String getToken() throws IOException
IOException - exception thrown from token acquisition operations.public void refreshToken()
throws IOException
IOException - exception thrown from token acquisition operations.public void setToken(String token)
token - the token stringpublic String getScheme()
public void applyCredentialsFilter(okhttp3.OkHttpClient.Builder clientBuilder)
ServiceClientCredentialsapplyCredentialsFilter in interface ServiceClientCredentialsclientBuilder - the builder for building up an OkHttpClient/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/