requarks / wiki-v1

Legacy version (1.x) of Wiki.js
https://wiki.js.org
GNU Affero General Public License v3.0
101 stars 75 forks source link

Generic OAuth2 Provider doesn't login #82

Open codehtmai opened 6 years ago

codehtmai commented 6 years ago

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.

remiakn commented 6 years ago

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 commented 6 years ago

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.

codehtmai commented 6 years ago

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

remiakn commented 6 years ago

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".

maeldd commented 6 years ago

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.

codehtmai commented 6 years ago

@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.

maeldd commented 6 years ago

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 !

mfevzikorkutata commented 5 years ago

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...

JamieGoodson commented 4 years ago

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 😔