2023-03-29 18:01:16 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
json.partial! 'api/auth_providers/auth_provider', auth_provider: provider
|
|
|
|
|
|
|
|
# OAuth 2.0
|
|
|
|
|
|
|
|
if provider.providable_type == 'OAuth2Provider'
|
|
|
|
json.providable_attributes do
|
|
|
|
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'
|
|
|
|
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, :client__identifier, :client__secret, :client__authorization_endpoint,
|
|
|
|
:client__token_endpoint, :client__userinfo_endpoint, :client__jwks_uri, :client__end_session_endpoint, :profile_url,
|
2023-09-07 16:22:57 +02:00
|
|
|
:post_logout_redirect_uri, :uid_field, :client__redirect_uri, :client__scheme, :client__host, :client__port,
|
|
|
|
:extra_authorize_params
|
2023-03-29 18:01:16 +02:00
|
|
|
end
|
|
|
|
end
|
2024-01-26 21:24:33 +01:00
|
|
|
|
|
|
|
if provider.providable_type == 'SamlProvider'
|
|
|
|
json.providable_attributes do
|
2024-03-27 14:41:30 +01:00
|
|
|
json.extract! provider.providable, :id, :sp_entity_id, :idp_sso_service_url, :profile_url, :idp_cert_fingerprint, :idp_cert, :idp_slo_service_url,
|
|
|
|
:authn_requests_signed, :want_assertions_signed, :sp_certificate, :sp_private_key
|
2024-01-26 21:24:33 +01:00
|
|
|
end
|
|
|
|
end
|