-
Notifications
You must be signed in to change notification settings - Fork 49
Feat/params to idp #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feat/params to idp #366
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
5806b6d
New topic - Upstream params
clairekinde11 04d6fa7
Upstream params
clairekinde11 2bc6e25
Next not save
clairekinde11 699d5c2
Next, Params
clairekinde11 e5dd6e9
Next, params
clairekinde11 c4cf00a
typo
clairekinde11 e4c959e
Next, params
clairekinde11 644f58f
Next, params
clairekinde11 000d61a
params, next
clairekinde11 e452ec7
Next, params
clairekinde11 dc8a970
Next, params
clairekinde11 b5ef689
Next, params
clairekinde11 a17ee92
Next, params
clairekinde11 a04a884
Next, params
clairekinde11 2b3b026
Next, params
clairekinde11 01b5c30
Next, params
clairekinde11 dbe478f
Next, params
clairekinde11 61e4be5
params
clairekinde11 3185f69
Update src/content/docs/authenticate/auth-guides/pass-params-idp.mdx
clairekinde11 82b5983
Typo
clairekinde11 ab89e59
Added note about account selector
clairekinde11 dc0529c
Added clear heading about account selelctor
clairekinde11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
150 changes: 150 additions & 0 deletions
150
src/content/docs/authenticate/auth-guides/pass-params-idp.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| --- | ||
| page_id: 64079be6-be72-4b63-a9d1-4466af4d49be | ||
| title: Pass parameters to identity providers | ||
| sidebar: | ||
| order: 2 | ||
| relatedArticles: | ||
| - fcf28a71-c3a8-4474-9564-ad089d3f2105 | ||
| - b663dbde-2045-4f51-bab4-84d0c9fbe15b | ||
| - 50284476-2442-414c-af20-01ed3ef4ca4e | ||
| --- | ||
|
|
||
| You can pass provider-specific parameters to an Identity Provider (IdP) during authentication. These are also known as 'upstream params'. The values your pass can either be static per connection or dynamic per user. | ||
|
|
||
| There's a number of reason why you might want to use upstream params: | ||
| - to create a smoother sign in experience - by passing the email through | ||
| - to offer an account switcher (such as the Google account switcher) during sign in | ||
|
|
||
| ## Limitations | ||
|
|
||
| - Each IDP has their own set of supported parameters and values, so you'll need to check their documentation to determine which URL parameters are supported. | ||
| - Applies only to OAuth 2.0 connections, e.g. [social connections](/authenticate/social-sign-in/add-social-sign-in/) and [Entra ID OAuth 2.0 enterprise connection](/authenticate/enterprise-connections/azure/). | ||
| - SAML IdPs do not support upstream parameters. | ||
|
|
||
| ## Static parameters | ||
|
|
||
| Static parameters can be useful when you have specific values you always want to pass on to the IDP. These are set in the connecction configuration screen. | ||
|
|
||
|  | ||
|
|
||
| The Upstream parameter field accepts JSON and the structure is as follows: | ||
|
|
||
| ```json | ||
| { | ||
| "<param_name_to_pass>": { | ||
| "value": "<your_hardcoded_value>" | ||
| } | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| Replace `<param_name_to_pass>` with the name of the parameter you wish to pass upstream to the IDP. | ||
| Replace `<your_hardcoded_value>` with the value of the parameter you wish to pass upstream. | ||
|
|
||
| For example, if you want Google to always show the account selector even if the user is already logged in with a Google account, pass the `prompt=select_account` parameter from Kinde. | ||
| This is how that would look: | ||
|
|
||
| ```json | ||
| { | ||
| "prompt": { | ||
| "value": "select_account" | ||
| } | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| Now, when your user clicks on the Google button and Kinde creates the URL to redirect to Google, it will append`&prompt=select_account`. | ||
|
|
||
| ## Dynamic parameters | ||
|
|
||
| Dynamic parameters cover the case where you don't know the value of the parameter ahead of time, and it needs to be populated on the fly during the auth flow. For example, if you need to pass on a parameter that was provided to Kinde in the auth URL. | ||
|
|
||
| This is the structure. | ||
|
|
||
| ```json | ||
| { | ||
| "<param_name_to_pass>": { | ||
| "alias": "<dynamic_param_name>" | ||
| } | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| The `alias` keyword tells Kinde which parameter from your auth url to use, and the value to pass upstream to the IDP. | ||
|
|
||
| Here is an example where we provide `login_hint` as part of the auth URL, where the email [`&login_hint=hello@example.com`](mailto:&login_hint=hello@example.com) is included on the URL. | ||
|
|
||
| ```html | ||
| https://<your_kinde_sudomain>.kinde.com/oauth2/auth | ||
| ?response_type=code | ||
| &client_id=<your_kinde_client_id> | ||
| &redirect_uri=<your_app_redirect_url> | ||
| &scope=openid%20profile%20email | ||
| &state=abc | ||
| &login_hint=hello@example.com | ||
| ``` | ||
|
|
||
| In this case both Kinde and the IDP use the parameter name `login_hint` so the configuration is the same on both sides: | ||
| Add this to the connection configuration: | ||
|
|
||
| } | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| In this case we are saying pass the `login_hint` parameter upstream to the IDP with the value Kinde received in the `login_hint` auth url param. So `&login_hint=hello@example.com` would be passed on to the provider. | ||
|
|
||
| Where the `alias` becomes especially powerful is when you want to re-map a parameter name to match the one an IDP expects. For example, let’s say that our IDP expects `username` instead of `login_hint` for the same value, in this case our JSON would look like this: | ||
|
|
||
| ```json | ||
| { | ||
| "username": { | ||
| "alias": "login_hint" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| In this case we are saying pass the `username` parameter upstream to the IDP with the value Kinde received in the `login_hint` auth url param. We remap the email value from `login_hint` to `username` and the parameter `&username=hello@example.com` would be passed on to the IDP. | ||
|
|
||
| ## Kinde-provided aliases | ||
|
|
||
| When an email address is populated during the auth flow, we make this available via the `login_hint` alias. | ||
|
|
||
| You might use this if you are using Home realm discovery with an Entra ID OAuth2.0 connection, and you want to pass the URL that the user entered on Kinde as the `login_hint`, upstream to Entra, to prevent the user having to enter their email twice. | ||
|
|
||
| If the user enters `hello@example.com` in the Kinde email field with the following configuration active, we set the `login_hint` parameter to `hello@example.com` via the Kinde provided alias. | ||
|
|
||
| ```json | ||
| { | ||
| "login_hint": { | ||
| "alias": "login_hint" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Multiple parameters | ||
|
|
||
| You can send multple parameters this way and mix-and-match between dynamic and static in the same configuration. For example if the user entered `hello@example.com` and the following was configured: | ||
|
|
||
| ```json | ||
| { | ||
| "prompt": { | ||
| "value": "login" | ||
| }, | ||
| "username": { | ||
| "alias": "login_hint" | ||
| } | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| This would result in `&prompt=login&username=hello@example.com` | ||
|
|
||
| ## Supported aliases | ||
|
|
||
| The values which can be used as an `alias` are: | ||
|
|
||
| - `prompt` | ||
| - `login_hint` | ||
|
|
||
| If you need other aliases added, let us know via a [feedback form](https://updates.kinde.com/). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.