wadahiro / keycloak-discord

Keycloak Identity Provider extension for Discord
121 stars 64 forks source link

Keycloak 20 - How to broker identity #30

Closed antonionardella closed 1 year ago

antonionardella commented 1 year ago

Hello, I have set the identity provider as follows image

But it is still asking the user to update the account information after logging in image

Client configuration image image

Can anyone help me understand how to use Keycloak to broker Discord's identity without saving the information? Thanks

laxadeR commented 1 year ago

Might not be exactly what you want, but you can just disable the "Review Profile" step from the Authentication flow configured to be used by discord provider on first login. If you only want to be able to link/login to existing Keycloak accounts, you can also disable user creation and confirm link existing account like this. image

Tawmy commented 1 year ago

Alternatively to this, you can enable the declarative-user-profile feature (this is still in preview!). You can find the configuraiton option here: https://www.keycloak.org/server/all-config?q=features.

When this is enabled, you can toggle "User Profile Enabled" in your realm settings, then use the "User profile" tab to remove first and last name fields for the realm, or make them non-mandatory using the JSON editor.

You'd then be able to keep the non-modified authentication flow while avoiding the user having to enter their first and last name.

wadahiro commented 1 year ago

But it is still asking the user to update the account information after logging in

Asking for a user profile setting on first login is the default behavior of Keycloak's Broker feature and has nothing to do with this extension.

This behavior can be changed by configuring the "first broker login" flow. If you check the "Settings" in the "Review Profile config", you will see that "Update Profile on First Login" is "missing". By setting this to "off", you should get the behavior you expect.

Screen Shot 2023-08-11 at 15 43 53