How to pass custom code_verifier on msal 2.0 for Azure B2C?

348 Views Asked by At

Generally, MSAL 2.0 auto-generates the code and code_verifier by itself. But Here, I have my custom flow when half part is done on another code i.e. to generate code_challenge. But When I call from front-end I am unable to find a way that I can pass my own code_verifier to get a token.

1

There are 1 best solutions below

0
On BEST ANSWER

We can use acquireTokenByCode method of useMsal to get token from B2C using code.

Header

const { instance, inProgress } = useMsal();

Code

instance.acquireTokenByCode(...tokenreq,{code:'123456',codeVerifier: 'ABCDSRIDD'})

Thank you