PingAM 7.5.0

Manage consent

Many OAuth 2.0 and OIDC flows require user consent to grant the client access to the user’s resources.

OAuth 2.0 and OIDC client applications can use implied consent. With implied consent, AM does not prompt for consent during authorization flows. This simplifies the flows. The user has only to sign on to grant the client access to protected resources.

To enable implied consent, follow these steps:

  1. In the AM admin UI, go to Realms > Realm Name > Applications > OAuth 2.0 > Clients > Client ID > Advanced.

  2. Select Implied Consent.

  3. Save your changes.

  4. Make sure AM lets users skip granting consent.

    By default, this is enabled in the OAuth 2.0 provider configuration, Realms > Realm Name > Services > OAuth2 Provider > Consent > Allow Clients to Skip Consent.

    If that is disabled for your deployment, switch to the OAuth2 Provider Overrides tab in the client profile, make the following changes to the settings, and save your work:

    Enable OAuth2 Provider Overrides

    Enabled

    Allow Clients to Skip Consent

    Enabled

To disable implied consent and force users to grant consent during authorization flows, disable the settings described in the previous steps.

Configure how the client application appears to the user. The following alternatives are available:

  • Customize the built-in consent screen:

    1. In the AM admin UI, go to Realms > Realm Name > Applications > OAuth 2.0 > Clients > Client ID.

      Edit the following settings under the Advanced tab, then save your work:

      Display name

      Display this name to the user when prompting for consent.

      Display description

      Explain the decision to the user when prompting for consent.

      Privacy Policy URI

      Add for the client applications privacy policy.

    2. Configure how scopes display.

      Users grant consent based on scopes. Scopes restrict what is shared with the client and limit what the client can do with the user’s data. In OAuth 2.0, the meanings of scopes depend on the implementation. In OpenID Connect, scopes map to standard user data claims; for example, the profile scope requests access to the user’s default profile claims.

      For details, refer to Display scopes in the consent screen.

  • Delegate consent gathering to another service.

    For details, refer to Remote consent.

AM can store the consent decisions in the user profile. This minimizes redundant prompts and improves the user experience.

When an OAuth 2.0 client application requests scopes, AM checks the user profile for scopes the user has already consented to. AM does not prompt the user to consent again to the same scopes, only scopes the user has not consented to.

To save consent:

  1. Add a multivalued string syntax attribute, such as custom_consent, to user profiles for saving consent decisions.

    The attribute must be of type array.

    For instructions on adding the attribute, refer to Update the identity repository for a custom attribute.

  2. In the AM admin UI, go to Realms > Realm Name > Services > OAuth2 Provider and select the Consent tab.

  3. In the Saved Consent Attribute field, add the name of the attribute you created, such as custom_consent.

  4. Save your changes.

To force AM to prompt for consent for a specific client request, add the prompt=consent parameter.

You can revoke a client application’s access at any time through the user dashboard page:

  1. Sign on as an end user.

    Your dashboard page displays.

  2. Expand Authorized Apps.

  3. Click the delete icon to revoke access:

    Revoke client application access through the user dashboard.
    Figure 1. Authorized Apps pane