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

Investigate google oauth login #1631

Closed
SMaxOwok opened this issue Nov 12, 2018 · 7 comments
Closed

Investigate google oauth login #1631

SMaxOwok opened this issue Nov 12, 2018 · 7 comments
Assignees
Labels
Type: Bug Issue represents a defect or error in Manifold.

Comments

@SMaxOwok
Copy link
Member

SMaxOwok commented Nov 12, 2018

@jojokarlin reports CUNY installation users encountering issues trying to login to manifold with google credentials

@SMaxOwok SMaxOwok added Type: Bug Issue represents a defect or error in Manifold. Status: Confirmation Needed Issue needs to be confirmed before it can be reviewed by Manifold team. labels Nov 12, 2018
@zdavis
Copy link
Member

zdavis commented Nov 16, 2018

Confirmed that there is a problem. Callback is white screen.

Logs look OK:

I, [2018-11-16T14:04:18.537936 #26550]  INFO -- : [af6a5bd3-57af-47a4-b161-65e7f902697b] Started GET "/auth/google_oauth2/callback?state=[REDACTED]&scope=email%20profile%20https://www.googleapis.com/auth/userinfo.profile%20https://www.googleapis.com/auth/userinfo.email" for 76.115.13.138 at 2018-11-16 14:04:18 +0000
I, [2018-11-16T14:04:18.812592 #26550]  INFO -- : [af6a5bd3-57af-47a4-b161-65e7f902697b] Processing by OauthController#authorize as HTML
I, [2018-11-16T14:04:18.812909 #26550]  INFO -- : [af6a5bd3-57af-47a4-b161-65e7f902697b]   Parameters: {"state"=>"[REDACTED]", "code"=>"[REDACTED]", "scope"=>"email profile https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email", "provider"=>"google_oauth2"}
I, [2018-11-16T14:04:18.822522 #26550]  INFO -- : [af6a5bd3-57af-47a4-b161-65e7f902697b] Completed 200 OK in 9ms (Views: 0.2ms | ActiveRecord: 1.2ms)

@zdavis zdavis removed the Status: Confirmation Needed Issue needs to be confirmed before it can be reviewed by Manifold team. label Nov 16, 2018
@SMaxOwok
Copy link
Member Author

Seems like it's erroring on a cross site scripting issue

/auth/failure?message=csrf_detected&strategy=google_oauth2

@zdavis
Copy link
Member

zdavis commented Dec 10, 2018 via email

@SMaxOwok
Copy link
Member Author

SMaxOwok commented Dec 10, 2018

Seems like the response page isn't being rendered

https://github.com/ManifoldScholar/manifold/blob/master/api/app/views/oauth/authorize.html.erb

[1] pry(#<OauthController>)> render template: "oauth/authorize"
=> " "

[2] pry(#<OauthController>)> ac = ActionController::Base.new  
=> #<ActionController::Base:0x00007fb1c9227720 @_action_has_layout=true, @_request=nil, @_response=nil, @_routes=nil>
[3] pry(#<OauthController>)> ac.render_to_string template: "oauth/authorize"
=> "<!DOCTYPE html>\n<html>\n  <head>\n    <title>Authentication successful!</title>\n    <style></style>\n  </head>\n  <body>\n    <h1>Authorization success!</h1>\n    <script type=\"text/javascript\">\n      window.opener.postMessage(null, \"*\");\n      window.close();\n    </script>\n  </body>\n</html>\n"

@SMaxOwok
Copy link
Member Author

@scryptmouse Do you have any ideas what's happening there?

zdavis added a commit that referenced this issue Dec 13, 2018
When we installed Draper to provide decorators to our mailers, we
inadvertently broke the OAuth controller. This is likely due to the
following issues in Draper, which do not appear to have been fully
solved in Draper 3.0.1.

Because this is the only place we use ActionView outside of Mailers,
for now we will just render the content from the controller. In the
future, if we need more view functionality, we'll use cells.

See:
rails/rails#27211
drapergem/draper#793

Fixes #1631
SMaxOwok pushed a commit that referenced this issue Dec 13, 2018
When we installed Draper to provide decorators to our mailers, we
inadvertently broke the OAuth controller. This is likely due to the
following issues in Draper, which do not appear to have been fully
solved in Draper 3.0.1.

Because this is the only place we use ActionView outside of Mailers,
for now we will just render the content from the controller. In the
future, if we need more view functionality, we'll use cells.

See:
rails/rails#27211
drapergem/draper#793

Fixes #1631
zdavis added a commit that referenced this issue Dec 14, 2018
When we installed Draper to provide decorators to our mailers, we
inadvertently broke the OAuth controller. This is likely due to the
following issues in Draper, which do not appear to have been fully
solved in Draper 3.0.1.

Because this is the only place we use ActionView outside of Mailers,
for now we will just render the content from the controller. In the
future, if we need more view functionality, we'll use cells.

See:
rails/rails#27211
drapergem/draper#793

Fixes #1631
@zdavis
Copy link
Member

zdavis commented Dec 15, 2018

Just confirmed that our fix to this solved the issue on the CUNY instance.

@zdavis
Copy link
Member

zdavis commented Jan 14, 2019

Sorry this took us so long to address, @jojokarlin — this fix has been deployed to the CUNY instance, and OAuth works as expected now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue represents a defect or error in Manifold.
Projects
None yet
Development

No branches or pull requests

3 participants