Provider Connect route not found

System Information
  • Strapi Version: 4.0.0
  • Operating System: Windows
  • Database: Sqlite
  • Node Version: 16.13.0
  • NPM Version: 8.1.0
  • Yarn Version: 1.22.15

After a fresh install of strapi with npx or yarn, the “/connect/{provider}” route doesn’t seems to exist. Even following the documentation for enabling github as an authentication provider, the route http://localhost:1337/connect/github returns 404 error

I’ve tried different providers and the problem is the same. It seems as the route doesn’t exists in strapi.

I don’t know if in Strapi 4 the route is different because the documentation seems to be of Strapi 3. I’m lost here.

Anyone can help please?

Yes, the routes have changed in v4 and you need /api in front of it, e.g., http://localhost:1337/api/connect/github

Also note that the redirect url in your Github application configuration (or other provider) needs to have /api in it, e.g., it should be http://localhost:1337/api/connect/github/callback instead of http://localhost:1337/connect/github/callback

In v4, I’ve got the Github login flow to work as far as getting the access token back, but the call to the callback URL returns “401 Unauthorized” - not sure why as I’ve verified that the access token is working to get my info from Github, and given the “public” role access to the “callback” action in users-permissions. If you get any further, let me know how you resolved it.

1 Like

I’ve had the same issues. Now I’m getting a route load error for middlewares when calling the connect endpoint. Seems like oauth features aren’t fully tested.

1 Like

having the same issue on redirects all 404 from discord google etc

Have you managed to resolve this?
I tried to manually define the route to authentication page (Microsoft, in my case), but obviously “connect” route sets some cookies, hence the auth does not work.