-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AccountController implementing MicrosoftIdentity/Account/xxx endpoints does not honour redirectUrl #760
Comments
Thanks for the heads-up @rollandjb |
My pleasure @jmprieur |
@rollandjb I tried to repro this bug, but cannot. Do you have repro steps? Do you want to force another redirect URL? |
I don't know ASP.NET Core web apps well enough to know how the page url is being remembered. In the case of a SPA hosted on the web app, one would need to specify the
The alternative is for me to implement my own endpoints. I would have to reroute those that are hard coded into the What do you think? |
moving to another iteration, as we need to update the templates as well and requires more time on our end to understand how to support this better & test. |
Yeah, i don't understand why the RedirectUrl is hard-coded to "~/" here: https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web.UI/Areas/MicrosoftIdentity/Controllers/AccountController.cs#L46 what if i want to redirect to a different page in my web app after logging in? |
@darraghjones @rollandjb fix has been merged into master. will be in next release. |
@darraghjones @rollandjb: released in 1.12.0 |
@jmprieur hey here, could you help me, please, I just updated version but seems it's not working, am I doing something wrong?
|
@AndreyZ1 : I'm not sure about the asp-route-redirectUri notation (I'm not familiar with it). Where is it documented? We used: <a href="/MicrosoftIdentity/Account/SignIn?redirectUri=/TodoList">Sign In</a> Maybe make sure that |
@jmprieur Just tried to use hardcoded link |
No @AndreyZ1 microsoft-identity-web/tests/WebAppCallsWebApiCallsGraph/Client/Views/Shared/_LoginPartial.cshtml Line 12 in b348c48
just update Microsoft.Identity.Web and Microsoft.Identity.Web.UI |
@jmprieur thank you a lot for help, I updated only Microsoft.Identity.Web and forgot about Microsoft.Identity.Web.UI. |
Thanks for the update, @AndreyZ1 |
@jmprieur yes, without any problems. |
I am not sure what was fixed in earlier builds but I still can't make it work. The code is very simple as given below.
Can anyone please help to fix the issue? |
@jeevanthespark : did you try with: <li><a href="/MicrosoftIdentity/Account/SignIn?redirectUri=/Claims">Sign In</a></li> |
Yes, I did. It is now redirecting but there are other issues. Initially, there were a couple of issues identified on my code.
|
Which version of Microsoft Identity Web are you using?
Note that to get help, you need to run the latest version.
Microsoft Identity Web 1.2.0
Where is the issue?
Is this a new or an existing app?
This is an app in development
Repro
Expected behavior
Clicking on the link should take me to the page at
yyy
Actual behavior
Takes me to the route of the application,
/
Possible solution
Set the
redirectUrl
property of AuthenticationProperties to the incoming query valueAll endpoints should honour
redirectUrl
Additional context / logs / screenshots
This will allow clients to use
MicrosoftIdentity/Account/xxx
endpoints and land the user on desired page.The text was updated successfully, but these errors were encountered: