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

Can't login with Auth0 #8492

Closed
gjsman opened this issue Oct 14, 2017 · 14 comments
Closed

Can't login with Auth0 #8492

gjsman opened this issue Oct 14, 2017 · 14 comments

Comments

@gjsman
Copy link

gjsman commented Oct 14, 2017

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

@gjsman gjsman mentioned this issue Oct 15, 2017
@Lawri-van-Buel
Copy link
Contributor

Scope should be filled. (Per RFC 6749)

@Lawri-van-Buel
Copy link
Contributor

Also read up on what each path should be.

@gjsman
Copy link
Author

gjsman commented Oct 16, 2017

Scope = openid (Still doesn't change a thing)

Each path is set to exactly (For each) what they should be.

@Lawri-van-Buel
Copy link
Contributor

Do the oauth login by hand and verify its right.

@gjsman
Copy link
Author

gjsman commented Oct 17, 2017

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.

@ToniIltanen
Copy link

set the scope to: openid profile

@707eric
Copy link

707eric commented Nov 2, 2017

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]

@707eric
Copy link

707eric commented Nov 2, 2017

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.

@gjsman
Copy link
Author

gjsman commented Nov 2, 2017

@707eric

Is there a way to use the username field?

Unbelievably, IT TOTALLY WORKED!!! YES!!!

@707eric
Copy link

707eric commented Nov 2, 2017

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.

@gjsman gjsman closed this as completed Nov 2, 2017
@simonv3
Copy link

simonv3 commented May 30, 2018

Did you all get merging of existing e-mail accounts working for this?

@707eric
Copy link

707eric commented May 30, 2018

I updated my last post with the current settings which seem to do everything I needed.

@gjsman
Copy link
Author

gjsman commented Oct 15, 2019

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

@gjsman
Copy link
Author

gjsman commented Oct 15, 2019

Merging of existing email accounts also works with the above settings @707eric @simonv3

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

5 participants