Security Context
Security context is a structure within an application that encapsulates the user identity details of the user logged in. It plays a key role in managing user identity and access control throughout the application.
Key Features of a Security Context
User Identity Management
- Profile Information: It often aggregates user profile details like name, first name, last name, phone number, email, id.
- Claims: It contains detailed assertions (claims) about the user's identity, such as personal attributes or identifiers.
Note: The Security Context is visible only when "Enable Authentication" is set to "Yes" in the module metadata.
Following are the functions accessible under Security Context in Expression Builder.
| Function Name | Description | Comments |
|---|---|---|
| Roles | The ‘Roles’ function retrieves the roles assigned to the current user based on the authentication token. It provides a list of roles that the user has been assigned, which can be used to enforce access control and authorization logic within the application. | It can be used for both OIDC and Cookie authentication types. |
| Scopes | The ‘Scopes’ function retrieves the scopes granted to the current user using authentication token. Scopes define the permissions or level of access to resources granted to the user. | It can be used for both OIDC and Cookie authentication types. |
| Claims(key) | The ‘Claims’ function retrieves the claims associated with the user's identity. Claims contain user-related metadata such as name, user ID, email, roles or other identity attributes. | It can be used for both OIDC and Cookie authentication types. |
| GetProfile() | The ‘GetProfile’ function retrieves the full user profile information from the authentication provider. This function fetches the user's profile details, which may include personal attributes like name, email, and other identity information. | It can be used for both OIDC and Cookie authentication types. |
| SetUserInfo | The ‘SetUserInfo’ function sets the user’s profile information within the application. | Used for Cookie authentication type only. |