wiki-v1 icon indicating copy to clipboard operation
wiki-v1 copied to clipboard

Generic OAuth2 Provider doesn't login

Open codehtmai opened this issue 8 years ago • 9 comments

Actual behavior

When we attempt to log in via the OAuth2 login button, it correctly forwards us to our login page. Upon authorization, we're redirected back to /login and not logged in. There are no errors on the page or in the logs.

I also noticed that the other login types are selectable as a Provider on the Create/Authorize User page, while OAuth2 is missing - I'm not sure if this is related or not, but maybe we need to be able to add the user first?

Expected behavior

Log in the user.

Steps to reproduce the behavior

Hook up an OAuth2 provider, then try to login using the OAuth2 button.

codehtmai avatar Apr 03 '18 15:04 codehtmai

I reproduce the exact same behavior and can add other provider such as Slack, but I suppose I need to connect to the wiki with admin user first and authorize users from the provider?

But unfortunately I cannot login with the admin user as I'm redirected to /login.

remiakn avatar Apr 12 '18 12:04 remiakn

A little update from my side, the issue wasn't with wiki.js.

I actually deploy it on AWS with CloudFront, the issue was related to the Cookies forwarding. I put this option to "All" and works well now.

remiakn avatar Apr 19 '18 15:04 remiakn

@remiakn Does that mean you got the OAuth2 login to work? Which option did you set to All?

codehtmai avatar Apr 19 '18 15:04 codehtmai

Hi @codehtmai, yes I'm using Slack for the authentication. Into AWS CloudFront console, when you click on the desired distribution and then the tab "Behavior" then you select the desired behavior and button Edit. In the "Edit Behavior" page, scroll down and then put the "Forward Cookies" to "All".

remiakn avatar Apr 20 '18 12:04 remiakn

Hi @codehtmai, did you get the OAuth2 login to work ? I have exactly the same issue with Google auth. When I select my Google account, I'm redirected back to /login and not logged in.

maeldd avatar Aug 21 '18 16:08 maeldd

@maeldd Unfortunately, no. We had to drop Wiki.JS and find a different solution, as this was a hard requirement for us. I would still go back to use it if they were able to support this functionality.

codehtmai avatar Aug 21 '18 17:08 codehtmai

Hi @remiakn, do you have an idea to fixed it on Heroku ? I understand the way you did it on AWS, but no way to find a solution for Heroku... Thanks !

maeldd avatar Aug 22 '18 08:08 maeldd

Hi All, Is there any progress on this issue? I am trying to integrate wiki.js v1.0.117 with GitLab oauth provider but it gives "Invalid User Email". Kind Regards...

mfevzikorkutata avatar Feb 09 '19 15:02 mfevzikorkutata

I'm having the same issue on wiki.js v2.0.12. After going through the Google OAuth login flow, we're redirected back to /login on the wiki and can't navigate to any other pages 😔

JamieGoodson avatar Feb 24 '20 09:02 JamieGoodson