craftcms / element-api

Create a JSON API/Feed for your elements in Craft.
MIT License
498 stars 56 forks source link

OAuth2 Access-Token Handling #114

Closed christophstockinger closed 3 years ago

christophstockinger commented 4 years ago

I have a question about using element api.

I have a frontend SPA requesting my api from CraftCMS to get the data. But I want to implement an authentication, which is implemented by an external OAuth2 service. My frontend SPA does the login handling with the OAuth2 service (default) and gets an access token. With a request to the API, the SPA sends the access token as a header. Everything up to now is easy for me and I can implement it myself.

Now the concrete question: Is there a help function in the element API that checks the access token on the OAuth2 service? Or do I have to implement this topic myself?