Skip to content

Conversation

@szogoon
Copy link

@szogoon szogoon commented Oct 1, 2025

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

@szogoon
Copy link
Author

szogoon commented Oct 1, 2025

@microsoft-github-policy-service agree company="TomTom"

Copy link
Contributor

@rayluo rayluo left a 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.

authParams.DomainHint = o.domainHint
authParams.State = uuid.New().String()
authParams.Prompt = "select_account"
authParams.Prompt = o.prompt
Copy link
Collaborator

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.

Copy link
Contributor

@rayluo rayluo Oct 3, 2025

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.

Copy link
Collaborator

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 ?

Copy link
Collaborator

@4gust 4gust left a 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.

return errors.New("missing query param 'prompt")
}
// if q.Get("prompt") == "" {
// return errors.New("missing query param 'prompt")
Copy link
Collaborator

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.

Copy link
Author

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?

@sonarqubecloud
Copy link

@szogoon szogoon requested review from 4gust and rayluo October 27, 2025 17:41
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.

3 participants