---
title: UserProfileContext
description: When the UserProfileFilter processes a request, it injects the user profile information into this context. This context provides raw JSON representation, and convenience accessors that map commonly used LDAP field names to a context names.
component: pinggateway
version: 2026
page_id: pinggateway:reference:UserProfileContext
canonical_url: https://docs.pingidentity.com/pinggateway/2026/reference/UserProfileContext.html
revdate: 2025-06-02T18:01:47Z
section_ids:
  UserProfileContext-propeties: Properties
  UserProfileContext-moreinfo: More information
---

# UserProfileContext

When the [UserProfileFilter](UserProfileFilter.html) processes a request, it injects the user profile information into this context. This context provides raw JSON representation, and convenience accessors that map commonly used LDAP field names to a context names.

## Properties

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

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

  User-friendly version of the username. This field is always fetched. If the underlying data store doesn't include `username`, this field is null.

  Example of use: `${contexts.userProfile.username}`

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

  Realm as specified by AM, in a user-friendly slash (/) separated format. Can be null.

  Example of use: `${contexts.userProfile.realm}`

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

  Distinguished name of the user. Can be null.

  Example of use: `${contexts.userProfile.distinguishedName}`

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

  Common name of the user. Can be null.

  Example of use: `${contexts.userProfile.commonName}`

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

  An unmodifiable map in the format `Map<String, Object>`, where:

  * Key: Name of a field in an AM user profile

  * Value: Value of a field in an AM user profile

  This context contains the object structure of the AM user profile. Any individual field can be retrieved from the map. Depending on the requested fields, the context can be empty or values can be null.

  Examples of use: `${contexts.userProfile.rawInfo}`, `${contexts.userProfile.rawInfo.username}`, `${contexts.userProfile.rawInfo.employeeNumber[0]}`.

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

  User profile information structured as JSON.

  Example of use: `${contexts.userProfile.asJsonValue()}`

## More information

[org.forgerock.openig.openam.UserProfileContext](../_attachments/apidocs/org/forgerock/openig/openam/UserProfileContext.html)

[UserProfileFilter](UserProfileFilter.html)
