EagerELK / ditty

Sinatra Based Web Application Framework
MIT License
8 stars 7 forks source link

Add omniauth Google OAuth2 integration / login #17

Closed jrgns closed 6 years ago

jrgns commented 6 years ago

Ditty already implements the identity login mechanism. This task is to add the Google OAuth2 login mechanism

shobhitic commented 6 years ago

We can't have symbol with - character as ruby thinks you're trying to subtract it. I think the key should be either :google_oauth2 or `"google-oauth2".

jrgns commented 6 years ago

@shobhitic :google_oath2 it is, then :)

jrgns commented 6 years ago

This is possible from 418a22646a2214e54e73dccd996176828a7caa72

In config/settings.yml add

authentication:
  google_oauth2:
    description: Log in Google
    icon: google
    arguments:
    - ENV['GOOGLE_CLIENT_ID']
    - ENV['GOOGLE_CLIENT_SECRET']
    - callback_path: '/auth/google_oauth2/callback'
      path_prefix '/auth'