Github auth provider not found for admin portal when domain managed outside netlify

We manage our domain outside of Netlify. When I go to my site’s /admin/ (Content Manager) page, I can’t login. I get a message that my auth provider is not found.

When I go directly to my netlify app (in customerio.netlify.app), I can get to the admin page and login perfectly fine.

I tried instituting a redirect from my regular /docs/admin directory to customerio.netlify and didn’t work either. Is there a way that I can either authorize github access from my domain (managed outside Netlify) or redirect to the admin portal in customerio.netlify.app domain so that my coworkers don’t have to remember the customerio.netlify address to access my admin portal?

Hi, @glosier. There is an API call to get the GitHub OAuth URL which looks like this:

https://api.netlify.com/auth?provider=github&site_id=<site id here>&scope=repo

The API call returns a 302 redirect to the correct OAuth URL at GitHub.

In this case, the API call doesn’t recognize the site at the other domain name because that domain name hasn’t been added to the site here:

https://app.netlify.com/sites/customerio/settings/domain#custom-domains

If you add customer.io as the site’s custom domain (or a domain alias if you already have a primary domain assigned), then the API call will be able to return the correct OAuth URL for your GitHub OAuth app you configured in the site’s Access Control > OAuth settings.

To summarize, because our API doesn’t see this custom domain associated with your site the required API call fails. If you add the domain to the site’s domain settings, the API call will succeed and it will start working.

If that doesn’t resolve the issue, please let us know.