# StoredRefreshTokenAuth (/docs/auth/api/interfaces/StoredRefreshTokenAuth)



[@kysoql/auth](/docs/auth/api) / StoredRefreshTokenAuth

Access-token manager that refreshes and persists rotated Salesforce
refresh tokens.

## Methods [#methods]

<a id="api-getsession" />

### getSession() [#getsession]

```ts
getSession(): Promise<SalesforceOAuthSession>;
```

Returns the cached session, refreshing from the stored refresh token when needed.

#### Returns [#returns]

`Promise`\<[`SalesforceOAuthSession`](/docs/auth/api/interfaces/SalesforceOAuthSession)>

***

<a id="api-refresh" />

### refresh() [#refresh]

```ts
refresh(): Promise<SalesforceOAuthSession>;
```

Forces a token refresh and persists any rotated refresh token.

#### Returns [#returns-1]

`Promise`\<[`SalesforceOAuthSession`](/docs/auth/api/interfaces/SalesforceOAuthSession)>

***

<a id="api-clear" />

### clear() [#clear]

```ts
clear(): Promise<void>;
```

Clears cached session state and deletes the persisted refresh token.

#### Returns [#returns-2]

`Promise`\<`void`>

## Properties [#properties]

| Property                                                          | Modifier   | Type                                                                     | Description                                                                                        |
| ----------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
| <a id="api-property-accesstokenprovider" /> `accessTokenProvider` | `readonly` | [`AccessTokenProvider`](/docs/auth/api/type-aliases/AccessTokenProvider) | Provider suitable for REST clients that can request a forced refresh after authentication failure. |
