-
Notifications
You must be signed in to change notification settings - Fork 100
feat: add WithPrompt option for AuthCodeURL #585
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
base: main
Are you sure you want to change the base?
Conversation
|
@microsoft-github-policy-service agree company="TomTom" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes sense to add WithPrompt option for PCA's interactive flow and CCA's auth code flow. I'll defer to my other teammates to review the implementation.
apps/public/public.go
Outdated
| authParams.DomainHint = o.domainHint | ||
| authParams.State = uuid.New().String() | ||
| authParams.Prompt = "select_account" | ||
| authParams.Prompt = o.prompt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We’re now changing the default from "select_account" to an empty string "".
Will need to test this a bit more to ensure everything behaves as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not aware that the "select_account" was the default value. That seems to be debatable choice in the first place. The default value on the protocol level is empty or completely absent.
In any case, changing the default from "select_account" to empty "" shall not cause catastrophic result because, again that was the default value in the specs and presumably most other libraries do that all the time. The perceived behavior will change, though, as the account selector will not pop up as often; but I think that shall be a welcome change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be tested live ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Just please update it with the couple of changes mentioned.
apps/public/public_test.go
Outdated
| return errors.New("missing query param 'prompt") | ||
| } | ||
| // if q.Get("prompt") == "" { | ||
| // return errors.New("missing query param 'prompt") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting this out will fix the failing test, but as I mentioned earlier, changing the default value from "select_account" to "" might introduce unintended behavior.
We'll need to test this further, and once confirmed, re-enable it and update the test to assert the correct value based on the expected response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I should put "select_account" as a default for AcquireInteractiveOption?
Co-authored-by: Nilesh Choudhary <107404295+4gust@users.noreply.github.com>
|



This PR adds WithPrompt option, so that URL can be crafted to use prompt parameter.