-
Notifications
You must be signed in to change notification settings - Fork 65
support noauth #143
base: master
Are you sure you want to change the base?
support noauth #143
Conversation
run Rack::URLMap.new('/' => Descartes::Web, '/auth/github' => Descartes::GithubAuth) | ||
class Descartes::NoAuth < Sinatra::Base | ||
before do | ||
session['user'] = { 'uid' => 'anonymous', 'email' => 'noemail' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe i don't understand the concept of noauth well enough. But why not 'email' => nil
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just didn't understand the use of the email field's usage well enough
Looking back I thought #136 covered this very well |
@damm @brntbeer @akvadrako hi guys. I'm fighting with this authentication issue for a while now, I'm not sure if I can apply any of these hacks to my config.ru to get foreman running. Also I've taken a look a this one https://github.com/damm/descartes/commit/84e3d4a239ee9e8ffc87ed70d6569eee729a4d74 but I can't figure it out how to apply those changes. Here's my config,ru: $stdout.sync = true use Rack::CanonicalHost do use Rack::Session::Cookie, :key => 'rack.session', use OmniAuth::Builder do class Descartes::NoAuth < Sinatra::Base run Rack::URLMap.new('/' => Descartes::Web, '/auth/github' => Descartes::GithubAuth,
OAuth type (either 'google' or 'github' or 'noauth') I'm still getting the "descartes/config.ru:16:in `block in ': missing SESSION_SECRET (RuntimeError)" error.. If anyone has anything to add, it'd be awesome. Thanks!!! |
export SESSION_SECRET="somethingrandom" |
Thanks @damm and sorry but somethingrandom??? I don't know what it would be suitable. Thanks! |
And, is this something I need to add to config.ru? what about .env file? |
@Mariano-gon It's due to how Sessions are handled (and encryption). It should be unique and random. http://www.sinatrarb.com/faq.html#sessions Slightly better could? be http://guides.rubyonrails.org/security.html#session-storage |
Man I just realized how badly I want this since a) Google deprecated new registrations for OpenID 2.0 and b) GitHub changed their OAuth too. IOW, neither OAUTH mech works for new deployments. 😭 |
Hopefully this patch is unintrusive enough