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
Describe the bug
openid-client is a Nodejs library that is not mean to run in browser environments. Since it is technically possible that RP's generate their PKCE pairs on the frontend, our implementation of PKCE pair generation should not depend on openid-client.
To Reproduce
npm i @opengovsg/sgid-client in a React project.
import { generatePkcePair() } from @opengovsg/sgid-client in a .jsx/.tsx file.
Run const { codeVerifier, codeChallenge } = generatePkcePair()
App crashes, with the following error message in console:
Expected behavior generatePkcePair() should run successfully and return <codeChallenge, codeVerifier> pair.
The text was updated successfully, but these errors were encountered:
As discussed in #52, the team currently does not endorse maintaining session details on the frontend, therefore as of now the team does not plan to support PKCE pair generation in the browser environment. If the user decides to do session management on frontend regardless, refer to https://www.npmjs.com/package/pkce-challenge.
Describe the bug
openid-client is a Nodejs library that is not mean to run in browser environments. Since it is technically possible that RP's generate their PKCE pairs on the frontend, our implementation of PKCE pair generation should not depend on openid-client.
To Reproduce
npm i @opengovsg/sgid-client
in a React project.import { generatePkcePair() } from @opengovsg/sgid-client
in a.jsx
/.tsx
file.const { codeVerifier, codeChallenge } = generatePkcePair()
Expected behavior
generatePkcePair()
should run successfully and return<codeChallenge, codeVerifier>
pair.The text was updated successfully, but these errors were encountered: