hpi-swt2 / workshop-portal

A Ruby on Rails app to manage workshops
http://workshopportal.herokuapp.com/
MIT License
21 stars 13 forks source link

Allow login via HPI OpenID #663

Closed cmfcmf closed 7 years ago

cmfcmf commented 7 years ago

This is part of #637.

All HPI users are automatically promoted to coaches. We still use Devise, which has support for OmniAuth. The link to login is located here: image

Further providers could be added, but I thought HPI OpenID was most important to begin with.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 28709dedf84c789f4f8f7c2f8350461714f3d4f2 on 637-hpi-openid into af76e08a8b77aa91d15b22a2c195778024451a56 on dev.

bjrne commented 7 years ago

That's weird because it works on heroku. Did you set up your openID Account correctly?

corinnaj commented 7 years ago

For me it doesn't work on Heroku either. We tried it with @aloeser account as well and got the same error: screenshot from 2017-06-19 10-34-07

bjrne commented 7 years ago

Okay, since this error was tied to a wrong configuration on the openID provider site I'd suggest to merge this for now and make a separate issue (#664) for an explanation along with a proper error message @corinnaj @aloeser ?

bjrne commented 7 years ago
2017-06-20T12:15:58.220488+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms (ActiveRecord: 1.0ms)
2017-06-20T12:15:58.232738+00:00 app[web.1]: 
2017-06-20T12:15:58.232740+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR:  column users.provider does not exist
2017-06-20T12:15:58.232740+00:00 app[web.1]: LINE 1: SELECT  "users".* FROM "users" WHERE "users"."provider" = 'h...
2017-06-20T12:15:58.232741+00:00 app[web.1]:                                              ^
2017-06-20T12:15:58.232742+00:00 app[web.1]: : SELECT  "users".* FROM "users" WHERE "users"."provider" = 'hpiopenid' AND "users"."uid" = 'https://openid.hpi.uni-potsdam.de/user/bjarne.sievers'  ORDER BY "users"."id" ASC LIMIT 1):
2017-06-20T12:15:58.232742+00:00 app[web.1]:   app/models/user.rb:49:in `from_omniauth'
2017-06-20T12:15:58.232743+00:00 app[web.1]:   app/controllers/users/omniauth_callbacks_controller.rb:5:in `hpiopenid'
2017-06-20T12:15:58.232743+00:00 app[web.1]: 
2017-06-20T12:15:58.232744+00:00 app[web.1]: 
2017-06-20T12:15:58.233226+00:00 heroku[router]: at=info method=GET path="/users/auth/hpiopenid/callback?_method=post&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.op_endpoint=https%3A%2F%2...