Netlify-cms: docs: identity widget conflicts with implicit OAuth

Created on 29 Aug 2018  路  7Comments  路  Source: netlify/netlify-cms

Describe the bug
Logging in doesn't work.
If i klick on the "Login with GitLab" button I get asked for the GitLab credentials and after that i get redirected to the page an a error occurs: "Not Found" shows up. (I'm not logged in so I'm still hanging on the login screen.

To Reproduce
Setting up a netlify cms instance with GitLab Implicit authentication.

Expected behavior
Successfully login, redirect to the Editor/Content/CMS View.

Screenshots
Error Screen:
netlifycms-firefox-error

Browser Console Error Log:

Error: "Gotrue-js: Failed to parse tokenResponse claims: {"access_token":"c006da9f51f131415bc41ffbd8083137c17aac90f480d701d605bd0c2f24c7f9","token_type":"bearer","state":"2bb47e3d-804e-4444-8a27-5de3793f01ba"}"
valuehttps://identity.netlify.com/v1/netlify-identity-widget.js:1:94536ehttps://identity.netlify.com/v1/netlify-identity-widget.js:1:92597valuehttps://identity.netlify.com/v1/netlify-identity-widget.js:1:89826completeExternalLoginhttps://identity.netlify.com/v1/netlify-identity-widget.js:1:113346bhttps://identity.netlify.com/v1/netlify-identity-widget.js:1:11476nhttps://identity.netlify.com/v1/netlify-identity-widget.js:1:11363shttps://identity.netlify.com/v1/netlify-identity-widget.js:1:80471onloadhttps://identity.netlify.com/v1/netlify-identity-widget.js:1:81292 user.js:153:8
    value user.js:153:8
    e user.js:37:4
    value index.js:147:17
    o.completeExternalLogin< store.js:100:2
    b mobx.module.js:911:15
    n mobx.module.js:902:15
    s netlify-identity.js:178:4
    u/O.onload netlify-identity.js:217:4

Applicable Versions:

  • Netlify CMS version: ^2.0.0 / 2.0.11
  • Git provider: GitLab
  • OS: Windows 10
  • Browser version: Firefox 61.0.2

CMS configuration

backend:
  name: gitlab
  repo: user/repo# Path to your GitLab repository
  auth_type: implicit # Required for implicit grant
  app_id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Application ID from your GitLab settings
  branch: master # Branch to update (optional; defaults to master)

media_folder: "static/img" # Folder where user uploaded files should go
public_folder: "img"




collections:
  - name: "slider" # Used in routes
    label: "Slider" # Used in the UI
    folder: "data/carousel" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    slug: "slider-{{slug}}" # Filename template
    fields: # The fields for each document, usually in front matter
      - {label: "Weight", name: "weight", widget: "number", default: "0"}
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Description", name: "description", widget: "string"}
      - {label: "Bild", name: "image", widget: "image"}

Additional context
Works with Chrome: Version 68.0.3440.106

Most helpful comment

Nevermind, I figured it out. The way to do it is to configure the gatsby-netlify-plugin in the gatsby-config.js, like so:

    options: {
      enableIdentityWidget: false,
    }

All 7 comments

You will need to remove the Identity script (netlify-identity-widget.js) from your site -- it conflicts with implicit authentication and is unnecessary.

If you think there is a good place to note that in the docs, please open a PR!

We could mention under GitLab backend docs - there should be a section for each extension once https://github.com/netlify/netlify-cms/issues/1692 is in play (very early on atm).

Hello! This might be a very beginner question, and I already apologize for that but: I'm not sure how to remove the identity script from my site?
I'm using gatsby, with the gatsby netify plugin, so most of the site is being generated, and scrumbled into a single big js file.

Nevermind, I figured it out. The way to do it is to configure the gatsby-netlify-plugin in the gatsby-config.js, like so:

    options: {
      enableIdentityWidget: false,
    }

I had exactly the same issue by using Gatsby, Netlify-CMS and Auth0 and the solution worked.

{
resolve: gatsby-plugin-netlify-cms,
options: {
enableIdentityWidget: false,
}
}

It's working perfect now. thanks.

could someone add this to the gitlab documentation is a waste of time people trying to figure it out on there own

Hey @fabianrios changing the docs won't be required once:
https://github.com/netlify/netlify-cms/pull/2920
https://github.com/netlify/netlify-identity-widget/pull/223

are merged

Was this page helpful?
0 / 5 - 0 ratings