OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/config/initializers/warden.rb

30 lines
1022 B

require 'open_project/authentication'
# Strategies provided by OpenProject:
require 'open_project/authentication/strategies/warden/basic_auth_failure'
require 'open_project/authentication/strategies/warden/global_basic_auth'
require 'open_project/authentication/strategies/warden/user_basic_auth'
require 'open_project/authentication/strategies/warden/session'
10 years ago
WS = OpenProject::Authentication::Strategies::Warden
strategies = [
10 years ago
[:basic_auth_failure, WS::BasicAuthFailure, 'Basic'],
[:global_basic_auth, WS::GlobalBasicAuth, 'Basic'],
[:user_basic_auth, WS::UserBasicAuth, 'Basic'],
[:session, WS::Session, 'Session']
]
strategies.each do |name, clazz, auth_scheme|
OpenProject::Authentication.add_strategy name, clazz, auth_scheme
end
include OpenProject::Authentication::Scope
api_v3_options = {
store: false
}
OpenProject::Authentication.update_strategies(API_V3, api_v3_options) do |_strategies|
[:global_basic_auth, :user_basic_auth, :basic_auth_failure, :session]
end