webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.22k stars 589 forks source link

feat(app-security): add idToken provider #4168

Closed Pavel910 closed 3 weeks ago

Pavel910 commented 3 weeks ago

Changes

This PR adds an idTokenProvider concept to the SecurityProvider in the Admin app. This was necessary to have, because Webiny supports various identity providers, which all work differently, but certain parts of the app, like Websockets, require us to have access to the idToken managed by each individual IDP, in order to attach it to requests.

This PR adds a setIdTokenProvider and a getIdToken methods to the Security context, which makes fetching of token generic for the consumer.

With this PR we've also updated Auth0 React SDK to v2.

How Has This Been Tested?

Manually.