Problem using GitHub OAuth instead of Netlify identity

I have followed instructions in Use OAuth provider tokens on your site | Netlify Docs including the setup in my Netlify site.

Yet, I’m still getting this error message:
image

instead of the expected dialog in the demo GitHub Authentication Example

What am I doing wrong?

Hi @pdesmarets,

I noticed you posted this in the Netlify CMS category, is this an issue with the Netlify CMS and the github backend or are you trying to do something else? The example you linked was not for the CMS. Can you also share a link to the site you are testing on? Thanks.

1 Like

I’m seeing same issue. I believe it is with Netlify CMS, because the question is how does the CMS (running in client code) know which Auth provider to use? It defaults to https://api.netlify.com according to backend docs.

So that gets my client code calling netlify APIs, but how does netlify know where that request is coming from? I was hoping it would be based on the repo field added to backend, but it doesn’t seem to work,.

What is very strange to me is that I can run this locally, but publishing to a real domain fails. I am including a brief screencast of this issue and live site. ( I did notice the site_domain field that may explain why it works locally, but setting it explicitly to cms.netlify.com doesn’t work in prod either, the auth succeeds but never sends back to client.)

https://edwardawebb.com/admin/#/

Video → https://edwardawebb.com/netlify-issues.mov

Hi Eddie, it is still not clear that the original post is related to Netlify CMS.
Regardless, when using the CMS with GitHub one needs to setup a GitHub OAuth Application which in turn requires some kind of backend service to facilitate the OAuth process (since GitHub doesn’t support implicit auth).
You can have Netlify provide the backend as described here Use OAuth provider tokens on your site | Netlify Docs or use one of these projects Overview | Netlify CMS | Open-Source Content Management System to deploy it yourself.
The reason it’s working locally is that when running from localhost the CMS uses a GitHub OAuth Application to make it easier to have a dev environment out of the box, but it should not be used for deployed sites.