Skip to content

Commit

Permalink
Add missing allow host and unlock_access
Browse files Browse the repository at this point in the history
  • Loading branch information
brunto committed Nov 14, 2023
1 parent 4f1f712 commit c8493bb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/controllers/saml_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def metadata

def sso
request = OneLogin::RubySaml::Authrequest.new
redirect_to(request.create(settings))
redirect_to(request.create(settings), allow_other_host: true)
end

def consume
Expand All @@ -23,6 +23,7 @@ def consume
user = User.create!(email:, password:, password_confirmation: password)

Check failure

Code scanning / CodeQL

Clear-text storage of sensitive information High

This stores sensitive data returned by
an assignment to password
as clear text.

Check failure

Code scanning / CodeQL

Clear-text storage of sensitive information High

This stores sensitive data returned by
an assignment to password
as clear text.
user.is_user = true
user.save
user.unlock_access!
end
sign_in(:user, user)

Expand All @@ -34,7 +35,7 @@ def consume
)

# redirect_to frontrnd
redirect_to "#{ENV['SSO_FRONTEND_REDIRECTION']}/#/?sso_token=#{access_token.token}"
redirect_to "#{ENV['SSO_FRONTEND_REDIRECTION']}/#/?sso_token=#{access_token.token}", allow_other_host: true
else
logger.info "Response Invalid. Errors: #{response.errors}"
@errors = response.errors
Expand All @@ -50,7 +51,7 @@ def logout

settings.name_identifier_value = session[:nameid] if settings.name_identifier_value.nil?

redirect_to(logout_request.create(settings))
redirect_to(logout_request.create(settings), allow_other_host: true)
end

# Handle the SLO response from the IdP
Expand All @@ -73,7 +74,7 @@ def slo
session[:nameid] = nil
session[:transaction_id] = nil

redirect_to ENV['SSO_FRONTEND_REDIRECTION']
redirect_to ENV['SSO_FRONTEND_REDIRECTION'], allow_other_host: true
end
end

Expand Down

0 comments on commit c8493bb

Please sign in to comment.