Missing code paramater with Omniauth

I am trying to use SSO and have users login. I am using the ruby on rails example setup code.

This is the error I receive:

omniauth: (auth0) Authentication failure! invalid_credentials: OAuth2::Error, invalid_request: Missing required parameter: code

I can set a breakpoint in the omniauth lib and I can see that the body of the request looks like:

grant_type => authorization_code
code => nil
redirect_uri => http://0.0.0.0:3000/auth/auth0/callback

Where should this ‘code’ parameter be set - is it an option somewhere in the auth0 initialiser?

Hi @chadwell

Welcome to the Auth0 Community!

Can you share the guide that you were following?

Thanks

Dawid

This guide ^^

It could be that my login button was incorrect, it should be:

 <%= button_to 'Login', '/auth/auth0', method: :post, data: { turbo: false } %>

but I had it as :slight_smile:

 <%= button_to 'Login', '/auth/auth0/callback', method: :post, data: { turbo: false } %>