Skip to content

Allow passing URLSearchParams directly to implicitAuthentication#817

Closed
nwalters512 wants to merge 1 commit intopanva:mainfrom
nwalters512:implicit-auth-urlsearchparams
Closed

Allow passing URLSearchParams directly to implicitAuthentication#817
nwalters512 wants to merge 1 commit intopanva:mainfrom
nwalters512:implicit-auth-urlsearchparams

Conversation

@nwalters512
Copy link

Given that the function is already using URLSearchParams internally, it seems like a natural extension to allow one to pass an instance of URLSearchParams if they already have it. This makes implicitAuthentication usable even when one doesn't have a web Request object.

Copy link
Author

Choose a reason for hiding this comment

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

I couldn't figure out how to get these tests to run locally. Even when running npm run tap:node locally, every test fails with the following:

  message: "Promise rejected during \"end-to-end w/ response_type=id_token, implicit, form_post, error_response\": unexpected HTTP response status code"

Any guidance would be helpful!

@nwalters512 nwalters512 marked this pull request as ready for review August 12, 2025 20:10
@panva
Copy link
Owner

panva commented Aug 13, 2025

Hello @nwalters512

I'm not sure in what case the existing inputs aren't "usable". The examples cover the use cases I have in mind.

@nwalters512
Copy link
Author

"When using a form_post response mode without a Request instance" from those docs matches my scenario. While that works, it's simply very clunky to require one to construct a full URL. It seems especially silly given that implicitAuthentication will immediately unpack things back into a URLSearchParams instance. If I already have a URLSearchParams, it seems like I should just be able to pass it directly.

I should have said this PR makes it more usable (or rather, more ergonomic).

@panva panva closed this Aug 29, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants