Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth0 implementation not working #962

Open
wtchen opened this issue Jun 30, 2023 · 6 comments
Open

Auth0 implementation not working #962

wtchen opened this issue Jun 30, 2023 · 6 comments

Comments

@wtchen
Copy link

wtchen commented Jun 30, 2023

NOTE: This issue system is intended for reporting bugs and tracking progress in software development. Although this software is licensed with an open-source license, any issue opened here may not be dealt with in a timely manner. IBI Group is able to provide technical support for custom deployments of this software. Please contact Ritesh Warade if your company or organization is interested in opening a support contract with us. Please remove this note when creating the issue.

Observed behavior (please include a screenshot if possible)

I was not able to log in with Auth0, getting the following error: Uncaught Error: Error: An error occurred when fetching client data for Lock: [https://cdn.us.auth0.com/client/Lt2sguBi0qWkjQS0qUhYDtU5BmNTXhLN.js?t1663261365919 1](https://cdn.us.auth0.com/client/vgRH8Hb3bBt94320kT1WIe7TrqgINyk5.js?t1663261365919) could not be loaded.

After doing some investigation, it looks the Auth0 no longer supports the API used in the latest datatools-ui release. So I forked this repo and updated the Auth0 APIs and some related code.

Now I'm able to log in, but I'm able to do much.

For example, I try to view a project:

image

But click on view test doesn't do anything.

Expected behavior

I should be able to log in with an Auth0 user, create a project, and view the project.

Steps to reproduce the problem

See above.

Any special notes on configuration used

See my forked code.

I'm running everything inside Docker.

Version of datatools-ui and datatools-server if applicable (exact commit hash or branch name)

v5.0.0 release

@miles-grant-ibigroup
Copy link
Contributor

Thanks for reporting! You are correct, we have some work to do when it comes to getting auth0 to function correctly. For now, our stopgap solution is as follows:

Using the https://github.com/ibi-group/datatools-ui/tree/auth-disable branch, env.yml now supports DISABLE_AUTH=true. This needs to also be set in the server env.yml.

These flags will disable auth0. There are still some bugs. For example, the homepage does not work, but localhost:9966/project does.

This branch is still a work in progress, but we welcome PRs.

@wtchen
Copy link
Author

wtchen commented Jul 6, 2023

Thanks! It's good to know about that branch.

I'm able to create a project, but I'm getting a blank page when I try to view the project. I was wondering you could help us get this running; we seem to be getting close.

I'm getting React errors like:

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

and

Uncaught TypeError: can't access property "length", project.labels is undefined

My env.yml is:

DISABLE_AUTH: true
AUTH0_CLIENT_ID: [MY_ID]
AUTH0_DOMAIN: [MY_DOMAIN]
MAPBOX_ACCESS_TOKEN: [MY_TOKEN]
MAPBOX_MAP_ID: mapbox/outdoors-v11
MAPBOX_ATTRIBUTION: <a href="https://www.mapbox.com/about/maps/" target="_blank">&copy; Mapbox &copy; OpenStreetMap</a> <a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a>
GRAPH_HOPPER_KEY: [MY_KEY]

I don't see any XHR to/from localhost:4000 (where datatools-server is running).

If helpful, here is my response for http://localhost:9968/api/manager/secure/project/854924ca-2fc9-452b-8138-0f0a67933a5b:

{
	"id": "854924ca-2fc9-452b-8138-0f0a67933a5b",
	"lastUpdated": 1688686979063,
	"dateCreated": 1688686979043,
	"name": "test3",
	"useCustomOsmBounds": false,
	"buildConfig": {
		"fetchElevationUS": null,
		"stationTransfers": null,
		"subwayAccessTime": null,
		"fares": null
	},
	"routerConfig": {
		"numItineraries": null,
		"walkSpeed": null,
		"stairsReluctance": null,
		"carDropoffTime": null,
		"updaters": null,
		"requestLogFile": null
	},
	"organizationId": null,
	"defaultTimeZone": "Africa/Abidjan",
	"autoFetchFeeds": true,
	"autoFetchHour": 2,
	"autoFetchMinute": 0,
	"bounds": {
		"north": 53.0,
		"south": 52.0,
		"east": 14.0,
		"west": 12.0
	},
	"pinnedDeploymentId": null,
	"regionalFeedSourceId": null,
	"otpServers": [],
	"user": null
}

@miles-grant-ibigroup
Copy link
Contributor

The homepage doesn't work with DISABLE_AUTH=true. Try visiting localhost:9966/project instead. Also, make sure DISABLE_AUTH=true is also set in the server's env.yml!

@binh-dam-ibigroup
Copy link
Contributor

Hi @wtchen, the code to support configs where DISABLE_AUTH = true (has to be both frontend and backend) is now in the dev branch for you to try out. Please update the issue status or close after testing. Thanks for your patience!

@CelieTrg
Copy link

CelieTrg commented Aug 9, 2024

Hello, I am facing the same issue. Unfortunately I need the authentication in order to use the application. Is the issue resolved or the answer is still disabling the authentication ?
Thanks in advanced !

@miles-grant-ibigroup
Copy link
Contributor

The answer is still disabling authentication!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants