You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nonce returned from authorizationUrl is inconveniently typed as string | undefined
I want to implement the following flow for generating the authorisation URL:
Controller calls a service to generate required params for authorisation URL (code verifier/challenge, nonce)
Controller calls another service to generate authorisation URL with the params generated in step 1
Controller saves code verifier and nonce in a cookie
But in step 1, there is no API to generate a nonce separately from auth URL. Workarounds are either:
Call .authorizationUrl just to get a random nonce. But this returns a nonce of type string | undefined, which forces me to write unnecessary null checks like return nonce ?? ''
Call generateCodeVerifier because it uses the same underlying function to generate the nonce. But this requires knowledge of sgID client internals.
Suggestion: expose a separate util function to generate a nonce, as with code verifier and code challenge.
The text was updated successfully, but these errors were encountered:
tl;dr there are 2 problems:
authorizationUrl
is inconveniently typed asstring | undefined
I want to implement the following flow for generating the authorisation URL:
But in step 1, there is no API to generate a nonce separately from auth URL. Workarounds are either:
.authorizationUrl
just to get a random nonce. But this returns a nonce of typestring | undefined
, which forces me to write unnecessary null checks likereturn nonce ?? ''
generateCodeVerifier
because it uses the same underlying function to generate the nonce. But this requires knowledge of sgID client internals.Suggestion: expose a separate util function to generate a nonce, as with code verifier and code challenge.
The text was updated successfully, but these errors were encountered: