Skip to content

Commit 251c307

Browse files
authored
Solve issue with login failing (#6077)
* Solve issue with login failing * rspec
1 parent ba14188 commit 251c307

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Metrics/ClassLength:
7373
# A calculated magnitude based on number of assignments,
7474
# branches, and conditions.
7575
Metrics/AbcSize:
76-
Max: 105
76+
Max: 110
7777

7878
Metrics/ParameterLists:
7979
CountKeywordArgs: false

app/controllers/external_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def create_user
8383
handle_session_timeout(session_timeout.to_i, user) if session_timeout
8484

8585
session[:session_token] = user.session_token
86-
session[:oidc_id_token] = credentials.dig('credentials', 'id_token')
86+
session[:oidc_id_token] = credentials.dig('credentials', 'id_token') if ENV['OPENID_CONNECT_LOGOUT_PATH'].present?
8787

8888
# TODO: - Ahmad: deal with errors
8989

greenlight-v3.nginx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ location @bbb-fe {
2424
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2525
proxy_set_header X-Forwarded-Proto $scheme;
2626
proxy_set_header Connection "";
27+
28+
proxy_buffer_size 128k;
29+
proxy_buffers 4 256k;
30+
proxy_busy_buffers_size 256k;
2731
}
2832

2933
location ~ '/api/v1/rooms/\w{3}-\w{3}-\w{3}-\w{3}.json$' {

sample.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ REDIS_URL=
4646
#OPENID_CONNECT_ISSUER=
4747
#OPENID_CONNECT_REDIRECT=
4848
#OPENID_CONNECT_UID_FIELD=sub
49+
# The next variable is optional and should only be set if you explicitly know the logout url for your authentication provider
50+
# You may also need to make changes to your nginx if you experience troubles logging in
51+
# See: https://github.com/bigbluebutton/greenlight/issues/6065#issuecomment-2905131224
4952
#OPENID_CONNECT_LOGOUT_PATH="/protocol/openid-connect/logout"
5053

5154
# Uncomment the following flag if you want to use EMAIL as a Unique ID backup, useful for setups with existing users who want to switch to an IDP setup.

spec/controllers/external_controller_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@
101101
get :create_user, params: { provider: 'openid_connect' }
102102

103103
expect(session[:session_token]).to eq(User.find_by(email: OmniAuth.config.mock_auth[:openid_connect][:info][:email]).session_token)
104+
end
105+
106+
it 'sets oidc id token if OPENID_CONNECT_LOGOUT_PATH is set' do
107+
request.env['omniauth.auth'] = OmniAuth.config.mock_auth[:openid_connect]
108+
ENV['OPENID_CONNECT_LOGOUT_PATH'] = '/logout'
109+
110+
get :create_user, params: { provider: 'openid_connect' }
111+
104112
expect(session[:oidc_id_token]).to eq(OmniAuth.config.mock_auth[:openid_connect][:credentials][:id_token])
105113
end
106114

0 commit comments

Comments
 (0)