8000 [fixes #9224] Always show the consent screen when a dynamic scope is requested and show the requested parameter by dgozalo · Pull Request #9802 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

[fixes #9224] Always show the consent screen when a dynamic scope is requested and show the requested parameter - #9802

Merged
mposolda merged 1 commit into
keycloak:mainfrom
dgozalo:9224-handle-dynamic-scopes-correctly-in-consent-screen
Feb 2, 2022
Merged

mposolda merged 1 commit into
keycloak:mainfrom
dgozalo:9224-handle-dynamic-scopes-correctly-in-consent-screen

Conversation

@dgozalo
@dgozalo dgozalo commented Jan 26, 2022 •
Copy link
Copy Markdown
Contributor

Always show the consent screen when a dynamic scope is requested and show the requested parameter

Also make sure we start using the common AuthorizationDetails in the code to standardize how we handle Scopes.

This is what the consent screen would look like with a dynamic scope with a parameter:

Updated image:

Screenshot 2022-02-01 at 11 05 48

@dgozalo dgozalo changed the title [fixes #9224] Always show the consent screen when a dynamic scope is requested and show the requested parameter <WIP> [fixes #9224] Always show the consent screen when a dynamic scope is requested and show the requested parameter Jan 26, 2022
@dgozalo
dgozalo force-pushed the 9224-handle-dynamic-scopes-correctly-in-consent-screen branch from 6b83ed3 to a2a2854 Compare January 26, 2022 15:27
@dgozalo dgozalo changed the title <WIP> [fixes #9224] Always show the consent screen when a dynamic scope is requested and show the requested parameter [fixes #9224] Always show the consent screen when a dynamic scope is requested and show the requested parameter Jan 26, 2022
@dgozalo
dgozalo force-pushed the 9224-handle-dynamic-scopes-correctly-in-consent-screen branch from a2a2854 to 07d275d Compare January 27, 2022 11:51
@dgozalo
dgozalo requested review from mposolda and stianst January 28, 2022 11:06
@dgozalo
dgozalo force-pushed the 9224-handle-dynamic-scopes-correctly-in-consent-screen branch from 07d275d to fe1f1ff Compare January 28, 2022 11:21
@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgozalo I have one review comment related to the message. WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder that it may be more user-friendly to display some message like

Send 200 USD

instead of something like:

Sending USD - Dynamic Scope Parameter: 200

The consent screen is displayed to end users, but end-user probably won't know at all what the Dynamic Scope Parameter is?

IMO the ideal experience is, that dynamic client scope send-money will have consentScreenText configured like sendMoneyScopeTxt . Then in messages_en.properties resource bundle will be some message like:

sendMoneyScopeTxt=Send {0} USD

Then in the ftl template, you would use something like:

${advancedMsg(clientScope.consentScreenText, clientScope.dynamicScopeParameter)}

This assumes single parameter, which won't be the case for the more complex RAR structures, but for parameterized scope single parameter is likely ok?

I guess this can require some changes in the AdvancedMessageFormatterMethod utility as it seems it does not yet have support for parameters sent to the messages.

WDYT?

Or would you prefer to go with this one and then improve message in the follow-up PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is definitely a great feature to have and as you said, it would be necessary for RAR too.

For this PR though, I thought of the format as the "default" one without any reference to parameters.

I made a small change to the format however, and it should read as:

<scope_name | scope_display_text>:

I'll open a follow up issue to handle the parameterized display text.

Always show the consent screen when a dynamic scope is requested and show the requested parameter

Improve the code that handles dynamic scopes consent and add some log traces

Add a test to check how we show dynamic scope in the consent screen and added missing template file change

Fix merge problem in comment and improve other comments

Fix the Dynamic Scope test by assigning it to the client as optional instead of default

Change how dynamic scopes are represented in the consent screen and adapt test
@dgozalo
dgozalo force-pushed the 9224-handle-dynamic-scopes-correctly-in-consent-screen branch from fe1f1ff to c754ce6 Compare February 1, 2022 10:11
@dgozalo
dgozalo commented Feb 1, 2022
Copy link
Copy Markdown
Contributor Author

@mposolda @stianst updated the PR with the suggested change and added a new image.

@dgozalo
dgozalo commented Feb 1, 2022
Copy link
Copy Markdown
Contributor Author

Issue referencing this enhancement: #9915

@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgozalo Thanks!

@mposolda
mposolda merged commit 3528e7b into keycloak:main Feb 2, 2022
@mposolda mposolda linked an issue Feb 2, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle Dynamic Scopes correctly in the consent screen

2 participants

0