---
title: OAuth2Context
description: Provides OAuth 2.0 access tokens. When the OAuth2ResourceServerFilter processes a request, it injects the access token into this context.
component: pinggateway
version: 2026
page_id: pinggateway:reference:OAuth2Context
canonical_url: https://docs.pingidentity.com/pinggateway/2026/reference/OAuth2Context.html
revdate: 2025-06-02T18:01:47Z
section_ids:
  OAuth2Context-properties: Properties
  OAuth2Context-moreinfo: More information
---

# OAuth2Context

Provides OAuth 2.0 access tokens. When the [OAuth2ResourceServerFilter](OAuth2ResourceServerFilter.html) processes a request, it injects the access token into this context.

## Properties

The context name is `oauth2`, and is accessible at `${contexts.oauth2}`. The context has the following properties:

* `"accessToken"`: *[org.forgerock.http.oauth2.AccessTokenInfo](../_attachments/apidocs/org/forgerock/http/oauth2/AccessTokenInfo.html)*

  The AccessTokenInfo is built from the following properties:

  * `"info"`: *[java.util.Map](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Map.html)*

    A map with the format `Map<String,Object>`, where

    * Key: Claim name

    * Value: Claim value in raw JSON

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

    Access token identifier issued from the Authorization Server.

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

    A set scopes associated to this token, with the format `Set<String>`.

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

    Timestamp of when the token expires, in milliseconds since epoch.

## More information

[org.forgerock.http.oauth2.OAuth2Context](../_attachments/apidocs/org/forgerock/http/oauth2/OAuth2Context.html)

[org.forgerock.http.oauth2.AccessTokenInfo](../_attachments/apidocs/org/forgerock/http/oauth2/AccessTokenInfo.html)
