Auth0 is not redirecting to required url after logout - auth0

I need auth0 to redirect me to a given url: http:\\localhost:3000\user-logout?id=xxx
for that in auth0 dashboard I have this:
But when I call it using this url: http://localhost:3000/logout?return_to=http%3A%2F%2Flocalhost%3A%3A3000/user-logout?id=123 it is redirecting me to http:\\localhost:3000
I am missing something in settings?

Related

How to redirect to the original path user navigated to after AAD authentication?

I have a pretty straightforward ASP .NET Core web site that uses Azure AD + OpenID for user authentication. Inside Azure I've added "https://my-site/signin-oidc" as a Redirect URI and inside my app settings I've set my CallbackPath to "/signin-oidc".
The problem is after authentication the browser always redirects to the home page.
For example the user will enter the following url into their address bar:
https://my-site/#/foo
They'll then be redirected to the azure sign-in page which has a uri like so:
https://login.microsoftonline.com/.../oauth2/v2.0/authorize?client_id=...&redirect_uri=https%3A%2F%2Fmy-site%3A64199%2Fsignin-oidc&[...]&sso_reload=true#/foo=
(Note where the '#/foo' fragment is placed)
After authentication succeeds they end up at the home page (https://my-site/).
Is there anyway for me to preserve the original URI and redirect the user to it after auth succeeds?
Try using the post_login_redirect_url query parameter for this.
If you want to automatically navigate the user to #/foo' after logging in, you can set your login redirect to ~/.../authorize?post_login_redirect_url=/#/foo.

How to logout with mod_auth_openidc

I use mod_auth_openidc to implement login on my website. I use multiple providers, so to initiate a login into one I redirect to:
/protected/redirect_uri/?target_link_uri=<urlencoded protected location>&iss=<urlencoded issuer>
which works as expected.
Now I want to initiate a logout in a similar manner, by refering the logout button to:
/protected/redirect_uri?logout=<urlencoded logoutpage>&iss=<urlencoded issuer>
but I simply get a 404. Of course /protected/redirect_uri does not actually exist but for some reson openidc does not handle the logout request.
The logout page is not protected and the provider has an end_session_endpoint in it's metadata.
the slash at the end of the redirect URI matters, if it is not there the request will not be considered as matching

Keycloak login page shows 'invalid parameter: redirect_uri'

I am using Keycloak authentication to authenticate an angular app and so far I have managed to redirect my login to Keycloak server. But when redirected instead of the login page I am getting a 500 error page with the messageĀ Invalid parameter: redirect_uri
When you created the client in Keycloak you set the required 'Valid Redirect URIs' field. Most likely the pattern you entered there doesn't match the redirect uri you are sending from your client. If you use ports numbers, they have to match too!.
If this is not the problem, check what your Keycloak server is logging and add those details here to your question.
this is occurred due to base url and valid redirect url are different. So I have added same URL on both the text box.Now its working fine.

Redirect on successful Login using servicestack

I've recently decided to migrate over to using servicestack authentication. From what I can tell, to have a redirect after a successful login of an oauth provider, you add the url to the appSettings of your web.config, i.e. oauth.GoogleOpenId.RedirectUrl.
My question is, is there anyway to make this more dynamic so that if a user get's redirected to the log on page when trying to access an authorized page, say their profile page, that once they log on successfully they get routed to their profile page instead of what's configured in the web.config? Forms authentication did this by using a 'returnUrl' query parameter.
Any help would be appreciated.
The behavior of accessing a protected page, redirecting to a /login page (overridable with HtmlRedirect on AuthFeature or Authenticate attribute) and on successful login should automatically redirect to the previously attempted protected page.
To do this you want to specify the redirect url in the continue or ReturnUrl FormData POST variable or QueryString when attempting to authenticate with the /auth service.

Twitter #anywhere login implementation

I'm new to Twitter #anywhere. Is #anywhere login feature is intended to integrate our website with Twitter login? just like Facebook connect?
If yes, What is the callback url used for and what callback url should be provided?
I've tried to add this #anywhere login feature to my site and I'm testing it from a localhost / 127.0.0.1 site. I use the following code
twttr.anywhere(function (T) {
T("#twitter-login").connectButton({
authComplete: function(user) {
//triggered when auth completed successfully
alert('test login complete');
currentUser = T.currentUser;
var userInfo = document.getElementById('user-info');
userInfo.innerHTML =
'<img src="' + currentUser.data('profile_image_url') + '"/>'
+ currentUser.data('screen_name');
}
});
});
If I don't provide any callback url, after authorizing the user, Twitter give a
Sorry, something went wrong.
The provided callback url http://localhost:9000/ is not authorized for the client registered to 'http://127.0.0.1:9000'.
So then I provide a custom callback url with the following code
twttr.anywhere.config({ callbackURL: "http://127.0.0.1:9000"});
After adding that code, no error occurred but I ended up having two tabs opened of the same page. One is the page I use to login and the other one is the callback url page. And also the code inside the "authComplete:" section is not run, the alert is not shown.
Did I do anything wrong?
Thank you
Twitter #Anywhere users domains to authenticate the callback url.
For twitter server, 127.0.0.1 and localhost are two differente things. As your are using localhost as your callback url, try adding this domain on the authorized domains configuration on your app configuration att dev.twitter.com