Lock 11 not redirecting to redirectUrl

I’m trying to upgrade from Lock 9 to Lock 11 for a Rails app with embedded login. Everything worked correctly with Lock 9, but now I am unable to get the redirect to work.

When the login dialog pops up I enter the username and password and the user does authenticate. I can tell this by looking at the logs in the Auth0 dashboard (Success cross origin authentication) and I also get an updated dialog that says “Thanks for logging in”. However, nothing happens after this.

The “Thanks for logging in” dialog just stays there and there is no attempt to redirect to the callback.

Here are my settings (some information has been changed to XXXX for privacy):

lock = new Auth0Lock(’<%= Rails.application.secrets.auth0_client_id %>’, ‘<%=Rails.application.secrets.auth0_domain %>’);

In my view:
lock.show(
{
allowAutocomplete: true,
allowShowPassword: true,
avatar: null,
loginAfterSignUp: false,
allowSignUp: false,
autoclose: true,
auth : {
audience: “https://XXXX.auth0.com/userinfo”,
redirect: true,
redirectUrl: “http://localhost:3000/auth/auth0/callback”,
responseType: “code”,
params: {
scope: “openid email profile”
}
}
}
);

config/initializers/auth0.rb
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’,
authorize_params: {
scope: ‘openid email profile’,
audience: ‘https://XXXX.auth0.com/userinfo
}
)
end

PLEASE NOTE: I had change “http://” to “http…” from links below since I can only put 3 links in a post (weird).

I do have “http…localhost:3000/auth/auth0/callback” listed in both “Allowed Callback URLs” and “http…localhost:3000” in “Allowed Web Origins”.

Oddly, I am required to have “http…localhost:3000/” in the Callback URL section. Although, I’m trying to go to “http…localhost:3000/auth/auth0/callback” else I get a “Failed cross origin authentication” error in the logs.

I’m not sure but it appears that Auth0 is trying to redirect id “http…localhost:3000/” instead of “http…localhost:3000/auth/auth0/callback”

Has anyone else encountered this issue? Any help would be appreciated. I’ve been trying to get this to work for 3 days.

Hey there @coros, I apologize for the delay in response.

I understand this topic was posted a bit in the past but if you are still facing this challenge today I would be happy to assist. Often times in those moments we snag a HAR file capture of the broken flow and build off of the breakdown there.

If this is still occurring, please obtain a HAR file and then direct message it over to me along with your tenant name. From there we can branch out and start to see what’s really happening.

Due to the age of this topic I will keep it open for another ten days just in case you have any additional questions, thank you.

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