Open bastonnc opened 1 year ago
Update: I shut down my laptop when I left work. It turn on by itself (like a big boy)
Now it works. I don't know if I should be mad or relieved. Oh well, that's six hours I'm not getting back...
I'm re-opening in case a genius has a clue as to what might've happened, as it might happen again.
i managed to re-create it three or four times by removing Directory.Read.All from everything while also being connected to my workplace through a VPN, but now I can't do it again even when those requirements are met. Odd thing is even when I re-institute the scopes i removed, the laptop always needs a restart to fix it. :\
I too am running into this issue. I tried many things, but restarting was the only way to resolve the issue.
Now that I have restarted, I can stop and restart my webapp, and the error comes back. But I am able to resolve the error by logging out, then logging back in. There is something going on with the token cache not working correctly
hi, i have the same issue. Anyone found out the solution?.
Did you use the AuthorizeForScopes attribute on the controller or the controller action? https://github.com/AzureAD/microsoft-identity-web/wiki/Managing-incremental-consent-and-conditional-access
This issue is for a: (mark with an
x
)The issue was found for the following scenario:
Please add an 'x' for the scenario(s) where you found an issue
Repro-ing the issue
Repro steps
I have a .net6 web app that uses graph to access info from my AAD. I had gone through the process of adding role restrictions and group restriction. Im using memory token cache and a middleware i built myself. I realized i didn't need group restrictions, mainly because it didn't work as expected, and as i was going through the process of removing those moving parts, it all went wrong. MsalUiRequiredException: No account or login hint was passed to the AcquireTokenSilent call. I tracked the problem down to the middleware, where it has this line :
var tokenAcquisition = httpContext.RequestServices.GetRequiredService<ITokenAcquisition>();
The middleware is used to make a Graph request and the put the base64 data of the user profile pic in a custom claim.The thing is the problem started roughly at 11am, but i've had this middleware untouched for thee days with no issue. I tried going back in my Git to two days ago, even though it was working fine yesterday, and the problem persists. My code doesn't logically seem to be the issue. I see it as if the problem is like barbs on a fence and my middleware a shirt getting caught on it; you can remove the shirt and be fine, but the barbs are still there.(and i need the shirt to not be naked)
I've looked at this issue here, but it doesn't exactly match my situation : https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/issues/540
I'm mainly confused because all was fine until it just wasn't.
This is my first time making a GitHub bug report/call for help, so I'm fairly certain I should be giving other information but I don't know what it is. I'll be haooy to provide it though.
Expected behavior The app starts, the cookie is there meaning the user is still signed in, so it uses that information to log the user in. The middleware doesn't fumble the ball and i have the information from the graph request. (It was doing it this morning)
Actual behavior The app starts, the cookie is there meaning the user is still signed in, so it uses that information to log the user in. The middleware fumbles the ball because the token is expired probably and an execption is thrown. MsalUiRequiredException: No account or login hint was passed to the AcquireTokenSilent call.
Possible Solution the issue refered earlier has a work around.
Additional context/ Error codes / Screenshots
Any log messages given by the failure
Add any other context about the problem here, such as logs.
OS and Version?
Versions
Attempting to troubleshooting yourself:
I tried making a new azure app but it didn't change anything
Mention any other details that might be useful