Hi
I have been following the tutorial for using Auth0 with Rails here Auth0 Ruby On Rails SDK Quickstarts: Login
The issue I have is that most Rails applications (and ours is one of them) , if I hit a URL that needs a login, it will redirect me to the login screen, and then upon successful authentication continue on it’s merry journey.
I haven’t found anything in the documentation about how to do that redirect?
I have had to construct a URL myself … that seems to work … but it’s been a bit of trial and error and I would have thought that there was a better Rails way.
state = SecureRandom.hex
session['omniauth.state'] = state
callback_url = auth_auth0_callback_url
url = "https://#{ApplicationConfig::Auth0::DOMAIN}/authorize?response_type=code&client_id=#{ApplicationConfig::Auth0::CLIENT_ID}&redirect_uri=#{callback_url}&state=#{state}&scope=openid profile email"
So is there a better way of doing this?
Cheers
Shane