Hi @sumit.sachdeva,
Welcome to the Auth0 Community
It’s not clear to me if you want to change the OIDC callback or you want the user to go back to a specific page after login.
The WithRedirectUri ()
method allows you to redirect the user to a specific path after authentication. The default value is “/”.
If you want to change the default /callback
path, which is the path where the OIDC middleware handles the tokens issued by Auth0, you should set this when you configure the middleware:
builder.Services
.AddAuth0WebAppAuthentication(options => {
options.Domain = builder.Configuration["Auth0:Domain"];
options.ClientId = builder.Configuration["Auth0:ClientId"];
options.CallbackPath = "<HERE_YOUR_CALLBACK_PATH>";
});
Be aware that the CallbackPath
property is intended to be handled by the OIDC middleware. You can change it just in case it conflicts with an existing endpoint in your application. Normally you don’t need to change it, and you can’t override its behavior anyway.
This is how the ASP.NET Core OIDC middleware works. The Auth0 SDK is just a wrapper around it.