Omniauth-based login library for Mumuki Platform
# in initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
Mumukit::Login.configure_omniauth! self
end
# in config/routes.rb
Rails.application.routes.draw do
Mumukit::Login.configure_login_routes! self
end
# in app/controllers/login_controller.rb
class LoginController < ApplicationController
Mumukit::Login.configure_login_controller! self
def failure
# define your failure login handler
end
end
# in app/controller/application_controller.rb
class ApplicationController < ActionController::Base
Mumukit::Login.configure_controller! self
private
def login_settings
# define your login settings
end
end
You can override the following methods:
login_methods
destroy_session_user_uid!
, save_session_user_uid!
, current_user_uid
In order to properly use this gem, your organization and user objects - as defined by Mumukit::Platform
- must implement some additional required methods:
organization:
#login_provider
#login_provider_settings
#login_provider_object
(but can be provided by Mumukit::Login::OrganizationHelpers
)user:
.for_profile
The gem is available as open source under the terms of the MIT License.