I’m writing a small SPA using Vue.js and need to implement the OAuth Authorization Code Flow with PKCE.
I have been looking for a JS library that can help me accomplish this task but have not been able to find anything that actually works (many libraries have security vulnerabilities and will not build on recent Node versions). I’m using ADFS 2019 as authorization server, so there is no vendor-specific library available.
I’m looking for the following functionality:
- Helper functions to make the initial authorizations request, handle the redirect and obtain access/ID/refresh tokens from the token endpoint (including PKCE code challenge)
- Mechanism to store and retrieve tokens on the client
- Helper function to exchange the refresh token for a new access token when needed (i.e. when the access token has expired)
A generic JS library would be great – but a component written specifically for Vue.js with an example implementation would be even better.
I figure this must be a very common requirement and that there must be something out there that fits the bill?