GitLab implicit login broken

Hi!

I wanted to try out Netlify CMS but am running into a blocker.

Environment:

  • GitLab self-hosted
  • Netlify configured with manual integration - working branch builds, previews, etc

I realized I can’t use Netlify’s git-gateway because it doesn’t support self-hosted Gitlab AFAIK.

I tried setting up the Gitlab backend for Netlify CMS following the instructions for Gitlab Implicit flows.

My config looks like this:

backend:
  name: gitlab
  repo: XXXXXXX/XXXXXXX
  auth_type: implicit
  app_id: XXXXXXX
  branch: "feature/DXS-616-netlify-cms"
  api_root: https://XXXXXXX/api/v4
  base_url: https://XXXXXXX
  auth_endpoint: oauth/authorize
media_folder: static/img
collections:
  ...

This is what happens

  1. Load admin page, click “Login with GitLab”

  2. Redirected to self-hosted GitLab Sign In/Application Authorization

  3. Redirected back to the admin, which displays this error:

In the console I see these errors:

I don’t know why Netlify CMS is trying to access Netlify Identity when I have GitLab implicit grant configured - AFAIK this shouldn’t need Netlify Identity?

May be similar to: https://github.com/netlify/netlify-cms/issues/1690

This turned out to be a sorta-silly issue: if you use implicit grant, you have to remove the netlify-identity-widget script that is provided in the Netlify Identity examples. I don’t think it’s mentioned on the backends page and it isn’t obvious that the “default” example config would conflict like that.

3 Likes

Sounds like we should get that behavior documented! You’re definitely using a rarely used feature, but we aren’t trying to make it harder to use! I’ll bring this up to our documentarians and see what can be done.

Many thanks for the follow-up with the solution!