Skip to content

Commit 44b2782

Browse files
committed
Correctly save ldap username on person
1 parent 93e0a22 commit 44b2782

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/models/auth_user.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def from_omniauth(auth)
99
person = where(uid: auth.uid).first_or_create do |user|
1010
user.name = auth.info.name
1111
user.email = auth.info.email
12+
user.ldap_username = auth.extra.raw_info.pitc.uid
1213
end
1314
person.last_login = Time.zone.now
1415
set_admin(person, auth)

config/initializers/devise.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
278278
config.omniauth :keycloak_openid, {
279279
name: :keycloak_openid,
280-
scope: [:openid, :email],
280+
scope: [:openid, :email, :pitc],
281281
client_id: AuthConfig.client_id,
282282
client_secret: AuthConfig.secret,
283283

0 commit comments

Comments
 (0)