Skip to content

Conversation

@salbito-workos
Copy link
Contributor

Description

This changset adds the prompt option to generating oauth authorization urls.

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@salbito-workos salbito-workos force-pushed the allow-passing-prompt-parameter-for-um-authorization-url branch from f8c66a2 to ec0980a Compare November 20, 2024 22:31
Comment on lines +384 to +385
if prompt is not None:
params["prompt"] = prompt
Copy link
Contributor

@mattgd mattgd Nov 20, 2024

Choose a reason for hiding this comment

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

Could you add a test for this new parameter? Looks like this PR is still in draft, so might be on the way.

@mthadley mthadley self-assigned this Nov 22, 2024
@mthadley mthadley marked this pull request as ready for review November 22, 2024 00:07
@mthadley mthadley requested a review from a team as a code owner November 22, 2024 00:07
@mthadley mthadley requested review from mattgd and mthadley November 22, 2024 00:07
Copy link
Contributor

@mattgd mattgd left a comment

Choose a reason for hiding this comment

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

Left one optional suggestion, but looks good.

Comment on lines +353 to +355
prompt (str): Used to specify whether the upstream provider should prompt the user for credentials or other
consent. Valid values depend on the provider. Currently only applies to provider values of 'GoogleOAuth',
'MicrosoftOAuth', or 'GitHubOAuth'. (Optional)
Copy link
Contributor

@mattgd mattgd Nov 22, 2024

Choose a reason for hiding this comment

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

Looks like Google OAuth, Microsoft OAuth, and GitHub OAuth all have a pretty limited set of values for prompt. Could be nice to maintain a set of allowed values with a literal. Not required, though if we want to do it, would be good to do it now, otherwise it'd be a breaking change later.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the values are meaningful to the downstream providers (not us), are not consistent across them (though somewhat overlap), and if any providers changed later would require us to update the SDK before new values could be passed, I'm leaning towards skipping validation in order to stay decoupled.

Not a bad idea! Just not sure it's worth it in this particular case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, that makes sense!

@mthadley mthadley merged commit 079586f into main Nov 22, 2024
5 checks passed
@mthadley mthadley deleted the allow-passing-prompt-parameter-for-um-authorization-url branch November 22, 2024 17:25
@mthadley mthadley mentioned this pull request Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants