Skip to content

Commit 362b917

Browse files
committed
Fix the LDAP admin authentication option not working.
I'm not actually sure this was ever working, since we were missing the omniauth callback method.
1 parent 8b5eed7 commit 362b917

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/api-umbrella/web-app/app/controllers/admin/admins/omniauth_callbacks_controller.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ def persona
5656
login
5757
end
5858

59+
def ldap
60+
uid_field = request.env["omniauth.strategy"].options[:uid]
61+
uid = [request.env["omniauth.auth"]["extra"]["raw_info"][uid_field]].flatten.compact.first
62+
@email = uid
63+
login
64+
end
65+
5966
private
6067

6168
def login
@@ -85,6 +92,10 @@ def login
8592
end
8693
end
8794

95+
def signed_in_root_path(resource_or_scope)
96+
admin_path
97+
end
98+
8899
def after_omniauth_failure_path_for(scope)
89100
new_admin_session_path
90101
end

src/api-umbrella/web-app/config/locales/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ en:
88
google_oauth2: Google
99
myusa: MyUSA
1010
persona: Persona
11+
ldap: LDAP
1112
errors:
1213
messages:
1314
invalid_host_format: must be in the format of "example.com"

0 commit comments

Comments
 (0)