1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Read oidc scope as yaml symbol array

This commit is contained in:
Matt Jankowski 2024-06-03 09:52:37 -04:00
parent 850cc0c35c
commit 74af68e8a8
2 changed files with 4 additions and 6 deletions

View file

@ -27,13 +27,9 @@ Devise.setup do |config|
# OpenID Connect Strategy
if Rails.configuration.omniauth.oidc_enabled
oidc_options = Rails.configuration.omniauth.oidc
config.omniauth(
:openid_connect,
oidc_options.merge(
scope: oidc_options[:scope].split(',').map(&:to_sym) # Convert scope to symbol array
)
Rails.configuration.omniauth.oidc
)
end
end

View file

@ -60,7 +60,9 @@ shared:
issuer: <%= ENV.fetch('OIDC_ISSUER', nil) %> # NEED
discovery: <%= ENV.fetch('OIDC_DISCOVERY', 'false') == 'true' %> # OPTIONAL (default: false)
client_auth_method: <%= ENV.fetch('OIDC_CLIENT_AUTH_METHOD', nil) %> # OPTIONAL (default: basic)
scope: <%= ENV.fetch('OIDC_SCOPE', '') %>
scope: <% ENV.fetch('OIDC_SCOPE', '').split(',').each do |value| %>
- !ruby/symbol <%= value %>
<% end %>
response_type: <%= ENV.fetch('OIDC_RESPONSE_TYPE', nil) %> # OPTIONAL (default: code)
response_mode: <%= ENV.fetch('OIDC_RESPONSE_MODE', nil) %> # OPTIONAL (default: query)
display: <%= ENV.fetch('OIDC_DISPLAY', nil) %> # OPTIONAL (default: page)