<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) &gt; [TokenManager](./ibm-cloud-sdk-core.tokenmanager.md)

## TokenManager class

A class for shared functionality for storing, and requesting tokens. Intended to be used as a parent to be extended for token request management. Child classes should implement "requestToken()" to retrieve the token from intended sources and "saveTokenInfo(tokenResponse)" to parse and save token information from the response.

**Signature:**

```typescript
export declare class TokenManager 
```

## Constructors

<table><thead><tr><th>

Constructor


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[(constructor)(options)](./ibm-cloud-sdk-core.tokenmanager._constructor_.md)


</td><td>


</td><td>

Create a new TokenManager instance.


</td></tr>
</tbody></table>

## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[accessToken](./ibm-cloud-sdk-core.tokenmanager.accesstoken.md)


</td><td>

`protected`


</td><td>

string


</td><td>


</td></tr>
<tr><td>

[disableSslVerification](./ibm-cloud-sdk-core.tokenmanager.disablesslverification.md)


</td><td>

`protected`


</td><td>

boolean


</td><td>


</td></tr>
<tr><td>

[expireTime](./ibm-cloud-sdk-core.tokenmanager.expiretime.md)


</td><td>

`protected`


</td><td>

number


</td><td>


</td></tr>
<tr><td>

[headers](./ibm-cloud-sdk-core.tokenmanager.headers.md)


</td><td>

`protected`


</td><td>

OutgoingHttpHeaders


</td><td>


</td></tr>
<tr><td>

[refreshTime](./ibm-cloud-sdk-core.tokenmanager.refreshtime.md)


</td><td>

`protected`


</td><td>

number


</td><td>


</td></tr>
<tr><td>

[requestWrapperInstance](./ibm-cloud-sdk-core.tokenmanager.requestwrapperinstance.md)


</td><td>

`protected`


</td><td>

RequestWrapper


</td><td>


</td></tr>
<tr><td>

[url](./ibm-cloud-sdk-core.tokenmanager.url.md)


</td><td>

`protected`


</td><td>

string


</td><td>


</td></tr>
<tr><td>

[userAgent](./ibm-cloud-sdk-core.tokenmanager.useragent.md)


</td><td>

`protected`


</td><td>

string


</td><td>


</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[getToken()](./ibm-cloud-sdk-core.tokenmanager.gettoken.md)


</td><td>


</td><td>

Retrieves a new token using "requestToken()" if there is not a currently stored token from a previous call, or the previous token has expired.


</td></tr>
<tr><td>

[isTokenExpired()](./ibm-cloud-sdk-core.tokenmanager.istokenexpired.md)


</td><td>

`protected`


</td><td>

Checks if currently-stored token is expired


</td></tr>
<tr><td>

[pacedRequestToken()](./ibm-cloud-sdk-core.tokenmanager.pacedrequesttoken.md)


</td><td>

`protected`


</td><td>

Paces requests to requestToken().

This method pseudo-serializes requests for an access\_token when the current token is undefined or expired. The first caller to this method records its `requestTime` and then issues the token request. Subsequent callers will check the `requestTime` to see if a request is active (has been issued within the past 60 seconds), and if so will queue their promise for the active requestor to resolve when that request completes.


</td></tr>
<tr><td>

[requestToken()](./ibm-cloud-sdk-core.tokenmanager.requesttoken.md)


</td><td>

`protected`


</td><td>

Request a token using an API endpoint.


</td></tr>
<tr><td>

[saveTokenInfo(tokenResponse)](./ibm-cloud-sdk-core.tokenmanager.savetokeninfo.md)


</td><td>

`protected`


</td><td>

Parse and save token information from the response. Save the requested token into field `accessToken`<!-- -->. Calculate expiration and refresh time from the received info and store them in fields `expireTime` and `refreshTime`<!-- -->.


</td></tr>
<tr><td>

[setDisableSslVerification(value)](./ibm-cloud-sdk-core.tokenmanager.setdisablesslverification.md)


</td><td>


</td><td>

Sets the "disableSslVerification" property.


</td></tr>
<tr><td>

[setHeaders(headers)](./ibm-cloud-sdk-core.tokenmanager.setheaders.md)


</td><td>


</td><td>

Sets the headers to be included with each outbound request to the token server.


</td></tr>
</tbody></table>
