diff --git a/enterprise/app/controllers/api/v1/accounts/saml/callbacks_controller.rb b/enterprise/app/controllers/api/v1/accounts/saml/callbacks_controller.rb deleted file mode 100644 index 183daf64e..000000000 --- a/enterprise/app/controllers/api/v1/accounts/saml/callbacks_controller.rb +++ /dev/null @@ -1,50 +0,0 @@ -class Api::V1::Accounts::Saml::CallbacksController < Api::V1::Accounts::BaseController - skip_before_action :authenticate_user! - - def create - @saml_settings = AccountSamlSettings.find_by(account_id: @current_account.id, enabled: true) - - return render_saml_not_enabled unless @saml_settings - - render json: { - saml_settings: { - sp_entity_id: @saml_settings.sp_entity_id_or_default, - enabled: @saml_settings.enabled, - sso_url: @saml_settings.sso_url, - certificate_fingerprint: @saml_settings.certificate_fingerprint, - enforced_sso: @saml_settings.enforced_sso, - attribute_mappings: @saml_settings.attribute_mappings, - role_mappings: @saml_settings.role_mappings - }, - received_data: { - saml_response: params[:SAMLResponse], - relay_state: params[:RelayState] - }, - message: 'SAML callback received successfully' - } - end - - def sso - @saml_settings = AccountSamlSettings.find_by(account_id: @current_account.id, enabled: true) - - return render_saml_not_enabled unless @saml_settings - - render json: { - sso_url: @saml_settings.sso_url, - sp_entity_id: @saml_settings.sp_entity_id_or_default, - acs_url: acs_url, - certificate_fingerprint: @saml_settings.certificate_fingerprint - } - end - - private - - def render_saml_not_enabled - render json: { error: 'SAML not enabled for this account' }, status: :not_found - end - - def acs_url - # Use the new SAML callback URL - "#{ENV.fetch('FRONTEND_URL', 'http://localhost:3000')}/saml/#{@current_account.id}/callback" - end -end