# Redirect Uri coming from unknown source

**URL:** <https://community.auth0.com/t/redirect-uri-coming-from-unknown-source/189113>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [July 12, 2025, 7:50am UTC](https://community.auth0.com/t/redirect-uri-coming-from-unknown-source/189113 "2025-07-12T07:50:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manoj.damani](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/manoj.damani/32/49452_2.png) [@manoj.damani](https://community.auth0.com/u/manoj.damani)\
**Post date:** [July 12, 2025, 7:50am UTC](https://community.auth0.com/t/redirect-uri-coming-from-unknown-source/189113/1 "2025-07-12T07:50:11Z")

</div>

Hi there,

I am using .net to redirect users to the login page. The code for doing that looks like this:

[ApiController]  
[Route(“api/[controller]”)]  
public class AccountController : ControllerBase  
{

[EnableCors(“InternalCalls”)]  
[HttpGet(“Login”, Name = “Login”)]  
public async Task Login(string returnUrl = “https://.net/select”)  
{  
var authenticationProperties = new LoginAuthenticationPropertiesBuilder()  
.WithRedirectUri(returnUrl)  
.Build();  
await HttpContext.ChallengeAsync(Auth0Constants.AuthenticationScheme, authenticationProperties);

}  
}

Now for some reason, when I hit up the URL to login, it says “Callback URL mismatch.  
The provided redirect\_uri is not in the list of allowed callback URLs.”

I checked the logs and the redirect\_uri is shown as https://.net/callback instead of aforementioned https://.net/select. I have no idea where this uri is coming from. The code is clearly calling the redirect\_uri with the return URL.

Where is this uri coming from?

---

<div class="post-metadata">

**Author:** ![lionsalesgroup6](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lionsalesgroup6/32/75719_2.png) [@lionsalesgroup6](https://community.auth0.com/u/lionsalesgroup6)\
**Post date:** [July 15, 2025, 3:53pm UTC](https://community.auth0.com/t/redirect-uri-coming-from-unknown-source/189113/2 "2025-07-15T15:53:57Z")

</div>

Hi,

The issue is that `redirect_uri` is set to `https://.net/callback`, which is likely your app’s default Auth0 callback URL. The `returnUrl` (`https://.net/select`) you’re passing is not used as the `redirect_uri` directly, but as a parameter to redirect **after** the callback completes.

### Solution:

- Add `https://.net/callback` to your Auth0 “Allowed Callback URLs”.
- If you want to use `https://.net/select` directly as the `redirect_uri`, set it explicitly in `AuthenticationProperties`, and also add it to your allowed callbacks in Auth0

---

<div class="post-metadata">

**Author:** ![manoj.damani](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/manoj.damani/32/49452_2.png) [@manoj.damani](https://community.auth0.com/u/manoj.damani)\
**Post date:** [July 18, 2025, 6:29am UTC](https://community.auth0.com/t/redirect-uri-coming-from-unknown-source/189113/3 "2025-07-18T06:29:30Z")

</div>

Thank you for your help, reply marked as solution 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 1, 2025, 6:29am UTC](https://community.auth0.com/t/redirect-uri-coming-from-unknown-source/189113/4 "2025-08-01T06:29:31Z")

</div>

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