Skip to content

Commit

Permalink
Added ability to map attributes for LDAP (bigbluebutton#1779)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad authored Jun 11, 2020
1 parent 2c1a11e commit cf794db
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ gem 'omniauth-twitter'
gem 'omniauth-google-oauth2'
gem 'omniauth-bn-launcher', '~> 0.1.3'
gem 'net-ldap'
gem 'bn-ldap-authentication', '~> 0.1.3'
gem 'bn-ldap-authentication', '~> 0.1.4'
gem 'omniauth-bn-office365', '~> 0.1.1'

# BigBlueButton API wrapper.
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ GEM
bigbluebutton-api-ruby (1.7.0)
xml-simple (~> 1.1)
bindex (0.8.1)
bn-ldap-authentication (0.1.3)
bn-ldap-authentication (0.1.4)
net-ldap (~> 0)
bootsnap (1.4.6)
msgpack (~> 1.0)
Expand Down Expand Up @@ -337,7 +337,7 @@ DEPENDENCIES
action-cable-testing
bcrypt (~> 3.1.7)
bigbluebutton-api-ruby
bn-ldap-authentication (~> 0.1.3)
bn-ldap-authentication (~> 0.1.4)
bootsnap (>= 1.1.0)
bootstrap (~> 4.3.1)
byebug
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def ldap

return redirect_to(ldap_signin_path, alert: I18n.t("invalid_credentials")) unless result

@auth = parse_auth(result.first, ENV['LDAP_ROLE_FIELD'])
@auth = parse_auth(result.first, ENV['LDAP_ROLE_FIELD'], ENV['LDAP_ATTRIBUTE_MAPPING'])

begin
process_signin
Expand Down
2 changes: 2 additions & 0 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ OAUTH2_REDIRECT=
# LDAP_PASSWORD=password
# LDAP_ROLE_FIELD=ou
# LDAP_FILTER=(&(attr1=value1)(attr2=value2))
# LDAP_ATTRIBUTE_MAPPING=name=displayName;uid=uid; (See link above for more details)
LDAP_SERVER=
LDAP_PORT=
LDAP_METHOD=
Expand All @@ -83,6 +84,7 @@ LDAP_AUTH=
LDAP_PASSWORD=
LDAP_ROLE_FIELD=
LDAP_FILTER=
LDAP_ATTRIBUTE_MAPPING=

# Set this to true if you want GreenLight to support user signup and login without
# Omniauth. For more information, see:
Expand Down

0 comments on commit cf794db

Please sign in to comment.