Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
d0c168e6
Unverified
Commit
d0c168e6
authored
Dec 22, 2021
by
Ahmad Farhat
Committed by
GitHub
Dec 22, 2021
Browse files
Options
Downloads
Patches
Plain Diff
Added server cert verification for LDAP requests (#3010)
parent
9f372a55
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/sessions_controller.rb
+15
-6
15 additions, 6 deletions
app/controllers/sessions_controller.rb
with
15 additions
and
6 deletions
app/controllers/sessions_controller.rb
+
15
−
6
View file @
d0c168e6
...
@@ -142,12 +142,7 @@ flash: { alert: I18n.t("registration.insecure_password") } unless user.secure_pa
...
@@ -142,12 +142,7 @@ flash: { alert: I18n.t("registration.insecure_password") } unless user.secure_pa
ldap_config
[
:bind_dn
]
=
ENV
[
'LDAP_BIND_DN'
]
ldap_config
[
:bind_dn
]
=
ENV
[
'LDAP_BIND_DN'
]
ldap_config
[
:password
]
=
ENV
[
'LDAP_PASSWORD'
]
ldap_config
[
:password
]
=
ENV
[
'LDAP_PASSWORD'
]
ldap_config
[
:auth_method
]
=
ENV
[
'LDAP_AUTH'
]
ldap_config
[
:auth_method
]
=
ENV
[
'LDAP_AUTH'
]
ldap_config
[
:encryption
]
=
case
ENV
[
'LDAP_METHOD'
]
ldap_config
[
:encryption
]
=
ldap_encryption
when
'ssl'
'simple_tls'
when
'tls'
'start_tls'
end
ldap_config
[
:base
]
=
ENV
[
'LDAP_BASE'
]
ldap_config
[
:base
]
=
ENV
[
'LDAP_BASE'
]
ldap_config
[
:filter
]
=
ENV
[
'LDAP_FILTER'
]
ldap_config
[
:filter
]
=
ENV
[
'LDAP_FILTER'
]
ldap_config
[
:uid
]
=
ENV
[
'LDAP_UID'
]
ldap_config
[
:uid
]
=
ENV
[
'LDAP_UID'
]
...
@@ -277,4 +272,18 @@ flash: { alert: I18n.t("registration.insecure_password") } unless user.secure_pa
...
@@ -277,4 +272,18 @@ flash: { alert: I18n.t("registration.insecure_password") } unless user.secure_pa
# Set the user's social id to the one being returned from auth
# Set the user's social id to the one being returned from auth
user
.
update_attribute
(
:social_uid
,
@auth
[
'uid'
])
user
.
update_attribute
(
:social_uid
,
@auth
[
'uid'
])
end
end
def
ldap_encryption
encryption_method
=
case
ENV
[
'LDAP_METHOD'
]
when
'ssl'
'simple_tls'
when
'tls'
'start_tls'
end
{
method:
encryption_method
,
tls_options:
OpenSSL
::
SSL
::
SSLContext
::
DEFAULT_PARAMS
}
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment