Can't login with Auth0
Description:
I set up a OAuth thing with http://auth0.com/ but I can't sign in without it providing a server error.
Server Setup Information:
- Version of Rocket.Chat Server: 0.58.4
- Operating System: Ubuntu 16.04.3
- Deployment Method(snap/docker/tar/etc): snap
- Number of Running Instances: 1
OAuth Settings
Enabled = Yes Token Path = /oauth/token Identity Path = /userinfo Authorize Path = /authorize Token Sent Via = header Scope = (blank) Login Style = Popup
Relevant logs:
[34mI20171014-22:03:42.724(0) Exception while invoking method 'login' SyntaxError: Unexpected token < at Object.parse (native) at CustomOAuth.getAccessToken (/snap/rocketchat-server/1142/programs/server/packages/rocketchat_custom-oauth.js:166:17) at Object.handleOauthRequest (/snap/rocketchat-server/1142/programs/server/packages/rocketchat_custom-oauth.js:224:28) at OAuth._requestHandlers.(anonymous function) (packages/oauth2.js:27:31) at middleware (packages/oauth.js:203:5) at packages/oauth.js:176:5
Scope should be filled. (Per RFC 6749)
Also read up on what each path should be.
Scope = openid (Still doesn't change a thing)
Each path is set to exactly (For each) what they should be.
Do the oauth login by hand and verify its right.
I have used other services such as Auth0.com correctly, but I actually set up a Gitea (fork of Gogs) server using the same information successfully.
set the scope to: openid profile
You need to adjust your settings to:
Enabled = Yes URL = https://ACCOUNTNAME.auth0.com/ Token Path = oauth/token Identity Path = userinfo Authorize Path = authorize Token Sent Via = Payload Login Style = Popup Scope = openid profile email Username field = LEAVE BLANK
Its important you have / at the end of the url field. Without it you will need to add a / to the beginning for the Token, Identity Path, and Authorize fields
That should resolve the issue. Using those settings works for me.
[Updated 5/30/2018]
Also at the top of the setup screen in Rocket Chat you will see a message
"When setting up your OAuth Provider, you'll have to inform a Callback URL. Use " followed by the URL to use. You will need to add that URL in Auth0 in the box for "Allowed Callback URLs:" and you will need to make sure your site is using SSL.
@707eric
Is there a way to use the username field?
Unbelievably, IT TOTALLY WORKED!!! YES!!!
Glad it worked for you!
I'm still trying to figure out the Username field as well. I have tried a few things like email, username, user_id but so far no dice.
Did you all get merging of existing e-mail accounts working for this?
I updated my last post with the current settings which seem to do everything I needed.
Further updates for those with Auth0 and Rocket.Chat: I managed to get usernames, emails, and profile images to work! This means that it is now (almost) a fully-supported OAuth integration, and no longer has these missing bits (like missing emails, etc)!
To do this, use the following settings (some are copied from above): Enabled = Yes URL = https://ACCOUNTNAME.auth0.com/ Token Path = oauth/token Identity Path = userinfo Authorize Path = authorize Token Sent Via = Payload Login Style = Popup Scope = openid profile email
My settings: Username field = nickname Name field = name Avatar field = picture
Merging of existing email accounts also works with the above settings @707eric @simonv3