Class: Ldap::OmniauthCallbacksController
- Inherits:
-
OmniauthCallbacksController
- Object
- Devise::OmniauthCallbacksController
- OmniauthCallbacksController
- Ldap::OmniauthCallbacksController
- Extended by:
- Gitlab::Utils::Override
- Defined in:
- app/controllers/ldap/omniauth_callbacks_controller.rb
Constant Summary
Constants inherited from OmniauthCallbacksController
OmniauthCallbacksController::ACTIVE_SINCE_KEY, OmniauthCallbacksController::INVALID_FRAGMENT_EXP, OmniauthCallbacksController::InvalidFragmentError
Constants included from KnownSignIn
KnownSignIn::KNOWN_SIGN_IN_COOKIE, KnownSignIn::KNOWN_SIGN_IN_COOKIE_EXPIRY
Constants included from CookiesHelper
CookiesHelper::COOKIE_TYPE_ENCRYPTED, CookiesHelper::COOKIE_TYPE_PERMANENT
Constants included from AuthHelper
AuthHelper::LDAP_PROVIDER, AuthHelper::POPULAR_PROVIDERS, AuthHelper::PROVIDERS_WITH_ICONS, AuthHelper::SHA1_CHAR_PAIR_COUNT, AuthHelper::SHA256_CHAR_PAIR_COUNT
Class Method Summary collapse
Instance Method Summary collapse
- #fail_login(user) ⇒ Object
-
#ldap ⇒ Object
We only find ourselves here if the authentication to LDAP was successful.
- #set_remember_me(user, _auth_user) ⇒ Object
Methods included from Gitlab::Utils::Override
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
Methods inherited from OmniauthCallbacksController
#atlassian_oauth2, #auth0, #failure, #failure_message, #handle_omniauth, #jwt, #openid_connect, #salesforce, #saml
Methods included from SynchronizeBroadcastMessageDismissals
#synchronize_broadcast_message_dismissals
Methods included from SafeFormatHelper
Methods included from InternalRedirect
#full_path_for_uri, #host_allowed?, #referer_path, #safe_redirect_path, #safe_redirect_path_for_url, #sanitize_redirect
Methods included from AcceptsPendingInvitations
#accept_pending_invitations, #after_pending_invitations_hook
Methods included from CookiesHelper
Methods included from InitializesCurrentUserMode
Methods included from AuthHelper
#allow_admin_mode_password_authentication_for_web?, #any_form_based_providers_enabled?, #auth_active?, #auth_app_owner_text, #auth_providers, #button_based_providers, #button_based_providers_enabled?, #certificate_fingerprint_algorithm, #codes_two_factor_authentication_data, #crowd_enabled?, #delete_otp_authenticator_data, #delete_webauthn_device_data, #disable_two_factor_authentication_data, #display_providers_on_profile?, #enabled_button_based_providers, #enabled_button_based_providers_for_signup, #form_based_auth_provider_has_active_class?, #form_based_provider?, #form_based_provider_priority, #form_based_provider_with_highest_priority, #form_based_providers, #form_enabled_for_sign_in?, #icon_for_provider, #label_for_provider, #ldap_enabled?, #ldap_sign_in_enabled?, #link_provider_allowed?, #oidc_providers, #omniauth_enabled?, #popular_enabled_button_based_providers, #provider_has_builtin_icon?, #provider_has_custom_icon?, #provider_has_icon?, #provider_image_tag, #providers_for_base_controller, #saml_providers, #signup_button_based_providers_enabled?, #step_up_auth_params, #test_id_for_provider, #unlink_provider_allowed?
Methods included from AuthenticatesWithTwoFactorForAdminMode
#admin_mode_authenticate_with_two_factor, #admin_mode_authenticate_with_two_factor_via_otp, #admin_mode_authenticate_with_two_factor_via_webauthn, #admin_mode_prompt_for_two_factor
Class Method Details
.define_providers! ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/controllers/ldap/omniauth_callbacks_controller.rb', line 8 def self.define_providers! return unless Gitlab::Auth::Ldap::Config.sign_in_enabled? Gitlab::Auth::Ldap::Config.servers.each do |server| alias_method server['provider_name'], :ldap end end |
Instance Method Details
#fail_login(user) ⇒ Object
36 37 38 39 40 |
# File 'app/controllers/ldap/omniauth_callbacks_controller.rb', line 36 def fail_login(user) flash[:alert] = _('Access denied for your LDAP account.') redirect_to new_user_session_path end |
#ldap ⇒ Object
We only find ourselves here if the authentication to LDAP was successful.
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/ldap/omniauth_callbacks_controller.rb', line 18 def ldap return unless Gitlab::Auth::Ldap::Config.sign_in_enabled? if Gitlab::CurrentSettings.admin_mode return admin_mode_flow(Gitlab::Auth::Ldap::User) if current_user_mode.admin_mode_requested? end sign_in_user_flow(Gitlab::Auth::Ldap::User) end |
#set_remember_me(user, _auth_user) ⇒ Object
31 32 33 |
# File 'app/controllers/ldap/omniauth_callbacks_controller.rb', line 31 def set_remember_me(user, _auth_user) user.remember_me = params[:remember_me] if user.persisted? end |