auth0 / omniauth-auth0

OmniAuth strategy to login with Auth0
MIT License
125 stars 67 forks source link

Unable to configure New Universal Login with prompt config #114

Closed finleye closed 3 years ago

finleye commented 3 years ago

Describe the problem

Unable to pass prompt values to configure New Universal Login when using omniauth-rails_csrf_protection . The readme suggests passing these as query params when redirecting the user to Auth0, but when using the csrf protection gem, I'm using a POST request rather than a redirect.

What was the expected behavior?

I expect that I can pass prompt: { login: { description: 'Login to <OUR APPLICATION>' } } and see the New Universal Login reflect that copy change.

Reproduction

I've set the prompt key in the OmniAuth configuration as well as the query params for the POST request.

OmniAuth config

  1. Set the prompt argument when configuring OmniAuth.
  2. Attempt login and see the New Universal Login unchanged from its default.

Query String

  1. Set the params for the link generated for login within railse. i.e. <%= link_to 'Login', '/auth/auth0', params: { <PROMPT CONFIG> }, method: :post %>
  2. Attempt login and see the New Universal Login unchanged from its default.

Environment

davidpatrick commented 3 years ago

Thanks @finleye for raising this. Currently the library is pulling in the authorize parameters with Rack::Utils.parse_query(request.query_string), which only grabs the query from the URL. But it appears request.params it handled for us on POST and GET. I will open a PR to fix this.

finleye commented 3 years ago

Thanks @davidpatrick!