DEV Community

Cover image for How to Add a Custom OAuth2/OpenID Connect Provider to Strapi v4

How to Add a Custom OAuth2/OpenID Connect Provider to Strapi v4

Strapi on March 21, 2023

In this article, we will cover the required steps to add a custom OAuth2/OpenID Connect provider to Strapi 4. First things first, what are OAuth2 ...
Collapse
 
nagman profile image
nagman • Edited

Does this work with Community Edition?
I just want to connect to Strapi with Okta (and it is already supported in Purest and Grant, but not listed in Strapi providers).
I've added just some basic info in grant-config.js and providers-registry.js with okta, aaaand... then?

Do we need to rebuild the app? Is it necessary to patch each time we make edits for debugging?

I've found that I needed to load the http://localhost:1337/api/connect/okta page, but I have a ERR_INVALID_REDIRECT error.

I've tried to add a console.log() at the start of the providers-registry.js callback for okta, but it doesn't show up in the terminal.

I don't know what triggers this redirection and where.

EDIT: woupsies, maybe I haven't understood the purpose of this post.
It seems that for Strapi, SSO and SSO are two separate things. One is free and the other comes with the gold plan.
There's SSO for API authentication and SSO for admin login.
I wanted SSO for admin login, but - correct me if I'm wrong - all this post is about authenticating to the Strapi API from a frontend app, right?

Collapse
 
jefftian profile image
Jeff

Same questions with you. But after dig a lot, yes, it turned out you are right!

The SSO for API is free and can use this approach this article showed.

But the SSO for admin panel is enterprise plan only!