mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
(api) openid provider configuration api
This commit is contained in:
parent
08ce18d93f
commit
ecccf6a4ec
@ -82,11 +82,22 @@ class API::AuthProvidersController < API::ApiController
|
||||
elsif params['auth_provider']['providable_type'] == OAuth2Provider.name
|
||||
params.require(:auth_provider)
|
||||
.permit(:name, :providable_type,
|
||||
providable_attributes: %i[id base_url token_endpoint authorization_endpoint logout_endpoint
|
||||
providable_attributes: %i[id base_url token_endpoint authorization_endpoint
|
||||
profile_url client_id client_secret scopes],
|
||||
auth_provider_mappings_attributes: [:id, :local_model, :local_field, :api_field, :api_endpoint, :api_data_type,
|
||||
:_destroy, transformation: [:type, :format, :true_value, :false_value,
|
||||
mapping: %i[from to]]])
|
||||
elsif params['auth_provider']['providable_type'] == OpenIdConnectProvider.name
|
||||
params.require(:auth_provider)
|
||||
.permit(:name, :providable_type,
|
||||
providable_attributes: %i[id issuer discovery client_auth_method scope response_type response_mode display prompt
|
||||
send_scope_to_token_endpoint post_logout_redirect_uri uid_field extra_authorize_params
|
||||
allow_authorize_params client__identifier client__secret client__redirect_uri
|
||||
client__scheme client__host client__port client__authorization_endpoint client__token_endpoint
|
||||
client__userinfo_endpoint client__jwks_uri client__end_session_endpoint profile_url],
|
||||
auth_provider_mappings_attributes: [:id, :local_model, :local_field, :api_field, :api_endpoint, :api_data_type,
|
||||
:_destroy, transformation: [:type, :format, :true_value, :false_value,
|
||||
mapping: %i[from to]]])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -9,3 +9,13 @@ if @provider.providable_type == OAuth2Provider.name
|
||||
json.extract! @provider.providable, :id, :base_url, :token_endpoint, :authorization_endpoint, :profile_url, :client_id, :client_secret, :scopes
|
||||
end
|
||||
end
|
||||
|
||||
if @provider.providable_type == OpenIdConnectProvider.name
|
||||
json.providable_attributes do
|
||||
json.extract! @provider.providable, :id, :issuer, :discovery, :client_auth_method, :scope, :response_type, :response_mode, :display,
|
||||
:prompt, :send_scope_to_token_endpoint, :post_logout_redirect_uri, :uid_field, :extra_authorize_params,
|
||||
:allow_authorize_params, :client__identifier, :client__secret, :client__redirect_uri, :client__scheme,
|
||||
:client__host, :client__port, :client__authorization_endpoint, :client__token_endpoint, :client__userinfo_endpoint,
|
||||
:client__jwks_uri, :client__end_session_endpoint, :profile_url
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user