Repository URL to install this package:
|
Version:
4.0.0.pre.3 ▾
|
# HACK: Ensure Doorkeeper has the Engine URL helpers.
Doorkeeper::ApplicationController.send(:include,
Core::Engine.routes.url_helpers)
Doorkeeper.configure do
orm :active_record
resource_owner_authenticator do
current_user || redirect_to(new_user_session_url)
end
resource_owner_from_credentials do |_routes|
user = Core::User.find_for_database_authentication(email: params[:username])
user if user && user.valid_password?(params[:password])
end
authorization_code_expires_in 10.minutes
access_token_expires_in 12.hours
# provide refresh tokens along with access tokens
use_refresh_token
# link applications to users
enable_application_owner confirmation: true
# by default, set the public scope
default_scopes :public
# and also support these
optional_scopes :write, :admin
# "authorization_code" => Authorization Code Grant Flow
# "implicit" => Implicit Grant Flow
# "password" => Resource Owner Password Credentials Grant Flow
# "client_credentials" => Client Credentials Grant Flow
grant_flows %w(authorization_code password client_credentials)
# WWW-Authenticate Realm (default "Doorkeeper").
realm 'Get Fitter API'
end