---
title: OAuth2TokenExchangeContext
description: When the OAuth2TokenExchangeFilter succesfully issues a token, it injects the issued token and its scopes into this context.
component: pinggateway
version: 2026
page_id: pinggateway:reference:OAuth2TokenExchangeContext
canonical_url: https://docs.pingidentity.com/pinggateway/2026/reference/OAuth2TokenExchangeContext.html
revdate: 2025-06-02T18:01:47Z
section_ids:
  OAuth2TokenExchangeContext-properties: Properties
  OAuth2TokenExchangeContext-moreinfo: More information
---

# OAuth2TokenExchangeContext

When the [OAuth2TokenExchangeFilter](OAuth2TokenExchangeFilter.html) succesfully issues a token, it injects the issued token and its scopes into this context.

## Properties

The context name is `OAuth2TokenExchangeContext`, and is accessible at `${contexts.oauth2TokenExchange}`.

The context has the following properties:

* `"issuedToken"`: *[java.lang.String](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html)*

  The token issued by the Authorization Server.

* `"issuedTokenType"`: *[java.lang.String](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html)*

  The token type URN.

* `"scopes"`: *[java.util.Set](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Set.html)<[java.lang.String](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html)>*

  One or more scopes associated with the issued token, for example, `"scope1", "scope2", "scope3"`.

* `"rawInfo"`: *[org.forgerock.json.JsonValue](../_attachments/apidocs/org/forgerock/json/JsonValue.html)*

  The raw token info as issued by the Authorization Server.

## More information

[org.forgerock.openig.filter.oauth2.OAuth2TokenExchangeContext](../_attachments/apidocs/org/forgerock/openig/filter/oauth2/OAuth2TokenExchangeContext.html)

[OAuth2FailureContext](OAuth2FailureContext.html)

[OAuth2TokenExchangeFilter](OAuth2TokenExchangeFilter.html)

[RFC 6749: Error Response](https://www.rfc-editor.org/rfc/rfc6749#section-5.2)
