Many OAuth 2.0 and OpenID Connect flows require user consent to grant the client access to the user’s resources.
OAuth 2.0 and OpenID Connect 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:
In the AM admin UI, go to Realms > Realm Name > Applications > OAuth 2.0 > Clients > Client ID > Advanced.
Select Implied Consent.
Save your changes.
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
- Allow Clients to Skip Consent
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:
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.
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
profilescope 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.
Store consent decisions
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:
Add a multivalued string syntax attribute, such as
custom_consent, to user profiles for saving consent decisions.
The attribute must be of type
For instructions on adding the attribute, refer to Update the identity repository for a custom attribute.
In the AM admin UI, go to Realms > Realm Name > Services > OAuth2 Provider and select the Consent tab.
In the Saved Consent Attribute field, add the name of the attribute you created, such as
Save your changes.
To force AM to prompt for consent for a specific client request, add the