# Adding an extra param to auth0 call

**URL:** <https://community.auth0.com/t/adding-an-extra-param-to-auth0-call/57720>\
**Category:** Get Help\
**Tags:** omniauth-gem, auth0\
**Created:** [February 11, 2021, 11:00am UTC](https://community.auth0.com/t/adding-an-extra-param-to-auth0-call/57720 "2021-02-11T11:00:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bingobangobongo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bingobangobongo/32/12715_2.png) [@bingobangobongo](https://community.auth0.com/u/bingobangobongo)\
**Post date:** [February 11, 2021, 11:00am UTC](https://community.auth0.com/t/adding-an-extra-param-to-auth0-call/57720/1 "2021-02-11T11:00:24Z")

</div>

auth0 ruby gem → omniauth-auth0

This is a clarification of usage, I need to send an extra param in the request to auth0 which will be used in a custom rule. For example if the new param is called ‘foobar’ is this the correct way to pass it to auth0:

```
Rails.application.config.middleware.use OmniAuth::Builder do
  provider(
      :auth0,
      ENV['AUTH0_CLIENT_ID'],
      ENV['AUTH0_CLIENT_SECRET'],
      ENV['AUTH0_DOMAIN'] ,
      callback_path: '/auth/auth0/callback',
      provider_ignores_state: true,
      authorize_params: {
          scope: 'openid email profile',
          foobar: 'myvalue'
      }
  )
end

```

Button:  
`<%= button_to 'Login','auth/auth0', method: :post, class: 'btn btn-primary btn-lg' %>`

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 12, 2021, 6:14pm UTC](https://community.auth0.com/t/adding-an-extra-param-to-auth0-call/57720/3 "2021-02-12T18:14:08Z")

</div>

Hi @bingobangobongo ,

Are you requesting a review or sharing your findings? If the latter, thanks for the contributions! Otherwise, I’d be happy to take a look.

---

<div class="post-metadata">

**Author:** ![bingobangobongo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bingobangobongo/32/12715_2.png) [@bingobangobongo](https://community.auth0.com/u/bingobangobongo)\
**Post date:** [February 15, 2021, 4:29pm UTC](https://community.auth0.com/t/adding-an-extra-param-to-auth0-call/57720/4 "2021-02-15T16:29:15Z")

</div>

I am looking for some help, if the code I provided is the correct way to provide and extra param to Auth0 which is then used in a rule.

In the authorize params I have provided a custom attribute (foobar) with a value of ‘myvalue’. Is this the correct way to do this?

Thanks

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 16, 2021, 4:51pm UTC](https://community.auth0.com/t/adding-an-extra-param-to-auth0-call/57720/5 "2021-02-16T16:51:03Z")

</div>

This looks correct to me. Is it not working for you? Here it is stated in the docs:

[https://www.rubydoc.info/gems/omniauth-auth0/OmniAuth/Strategies/Auth0#authorize\_params-instance\_method](https://www.rubydoc.info/gems/omniauth-auth0/OmniAuth/Strategies/Auth0#authorize_params-instance_method)

---

<div class="post-metadata">

**Author:** ![bingobangobongo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bingobangobongo/32/12715_2.png) [@bingobangobongo](https://community.auth0.com/u/bingobangobongo)\
**Post date:** [February 16, 2021, 4:58pm UTC](https://community.auth0.com/t/adding-an-extra-param-to-auth0-call/57720/6 "2021-02-16T16:58:00Z")

</div>

Yes it is working I was finally able to test it. The docs were not clear that this was the correct approach so I am happy to have it verified.

Thanks.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 16, 2021, 5:01pm UTC](https://community.auth0.com/t/adding-an-extra-param-to-auth0-call/57720/7 "2021-02-16T17:01:18Z")

</div>

Great! Thanks for following up. 😄

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 3, 2021, 5:02pm UTC](https://community.auth0.com/t/adding-an-extra-param-to-auth0-call/57720/8 "2021-03-03T17:02:04Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
