Netlify-cms: identify_url config is ignored when using identity widget to authenticate

Created on 8 Jul 2020  路  13Comments  路  Source: netlify/netlify-cms

Setup:
We have a Hugo site hosted on Netlify here - https://www.stardog.com/
CMS works as expected.

We have added a subsite called Stardog Labs:
It's on Netlify here - https://stardog-labs.netlify.app/

On the main site _redirects file we are doing a reverse proxy
/labs/* https://stardog-labs.netlify.app/:splat 200!

This allows for our Labs subsite to render as expected here -
https://www.stardog.com/labs/

Goal:
We can continue to access the Labs CMS admin portal here https://stardog-labs.netlify.app/admin/

We would like to to access here - https://www.stardog.com/labs/admin/

Problem:
We keep receiving the following errors
Screenshot 2020-07-08 11 41 46
Screenshot 2020-07-08 11 41 37
Screenshot 2020-07-08 11 41 11

Additional setup info
Here is the config.yml setup for the Labs site

Screenshot 2020-07-08 11 44 58

Closing questions:
Is there something wrong with our config to allow this to work?
Are we missing a header like the 400 error indicates?

configuration bug

All 13 comments

@ccampb13, can you share the network traffic after clearing cache/from private mode and include the requests/responses to the identity service (please redact any auth tokens)?

hey @erezrokah here is what I see post clearing cache related to the identity service.

Screenshot 2020-07-08 12 55 12
Screenshot 2020-07-08 12 54 58
Screenshot 2020-07-08 12 54 46

When you click login there should be a request to the identity service settings.
Do you mind sharing that and the entire login flow requests until you get that git/settings one?

Hey @erezrokah here's a recording of the Network requests that I'm seeing. Not seeing any additional requests to the identity service settings.
https://recordit.co/6886WfqM9x

Actually @erezrokah, I cleared my local storage again and have a few extra network requests to show here.
http://recordit.co/aVeaqNrPSB

This request looks wrong here -
Request URL: https://www.stardog.com/.netlify/identity/token

It's looking for the identity token from the main site. I'd expect this request to be going here:

identity_url: https://stardog-labs.netlify.app/.netlify/identity as set in the config.yml file

If not to the identity_url set, then at least to the correct subdirectory https://www.stardog.com/labs/

@ccampb13 The identify_url config is ignored when using identity widget to authenticate. To use your identity_url config option, try logging in without the identity widget by removing the identity script from your index file <script src="https://identity-js.netlify.com/v1/netlify-identity-widget.js"></script> . You should be presented with simple email and password inputs login.

Awesome, thanks @barthc! That did the trick!

Will we lose any functionality with this setup?

Will we lose any functionality with this setup?

Nope, I don't think so. But with the identity widget, you can do other things like social login, invite, email change, etc.

Will we lose any functionality with this setup?

Nope I don't think so.

sweet. thanks again, @barthc!

Thanks @barthc, I think the CMS should set the identity url for the widget if the script exists in that case.
WDYT?
Re-opening so I can investigate further

@erezrokah we will need to handle setting the URL in the cms code, and also for the netlify plugin.

Update the description to better reflect the issue.
See workaround https://github.com/netlify/netlify-cms/issues/1027#issuecomment-596603284

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BerkeleyTrue picture BerkeleyTrue  路  3Comments

bkroggel picture bkroggel  路  3Comments

ciokan picture ciokan  路  3Comments

TomPichaud picture TomPichaud  路  3Comments

mikecrittenden picture mikecrittenden  路  3Comments