-
Notifications
You must be signed in to change notification settings - Fork 334
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
Microsoft account with MicrosoftAccountAuthenticationOptions does not seem to work #48
Comments
@kichalla does this look like what you just tested? Have you enabled logging to see what the error was? I'd be curious to see what the cookie headers looked like for the ufotoday.com requests and responses. |
|
I verified it again now and it works for me. However, I verified it with the OOB MVC template and haven't done any customization. |
@kichalla are you using a recent Microsoft account?
|
As a baseline, the MSA provider works if I only specify the ClientId and ClientSecret, no scopes required. My app does note have any Permissions specified either. I see one small bug here with the e-mail: Lines 58 to 62 in b850cd8
It first checks for the "mail" entry, which is present but null , so it returns string.Empty. Then it checks if that value was null, which does not match string.Empty, so it does not proceed to get the real e-mail value from "userPrincipalName" . This should be easy to work around by directly extracting "userPrincipalName" from the JObject User on the context.
Adding Requesting scope If I just specify the email or profile scopes then the login portal rejects them as invalid. Summary: You don't need scopes, and there's a small bug we need to address with reading the e-mail. |
Thanks @Tratcher, it works like you said, when not specifying scopes, but without the email. Is it scheduled to be fixed on v4 only or before that? This is my requests, just in case it can help to resolve the bug:
|
The next planned release is a 4.0 preview, I'll get this fixed by then. |
Do you think it will be possible to ship this fix as an update for v3.1? |
There is no update currently scheduled for v3.1 to include this in. |
We recently upgraded to v3.1 the MSA nuget. For few of the Older Apps Sign-In flow is broken. New apps created using apps.dev.microsoft.com is working. Here is the request and response logs from the broken app.
|
I am facing the same issue in my ASP.NET MVC projects after update the Microsoft.Owin.x nuget packages from v3.0.1 to v3.1.0. I have opened this question on ASP.NET forum but no fix solution until this moment: |
I am also facing this issue. I can't get the MS account auth to work even with no scopes. Whenever the client returns to the
That doesn't make sense - I cannot see any 400 errors (looking at fiddler all I see is 200s then 302s - in fact I can even see a 302 with Is there any way I can see more of what's happening under the hood to find out the actual error? Or does anyone have any suggestions as to how to make this work? Thanks! |
The 400 is happening on the backchannel. The server/middleware sends requests to microsoft to exchange the code and to get user information. To capture that traffic you can use a network level tracer like Message Analyzer https://www.microsoft.com/en-us/download/details.aspx?id=44226. |
Hello I have the same issue described in this topic. I used the workaround for email retrieve using "userPrincipalName" and it works. Still, I encounter another problems when having a gmail account which is linked to the Microsoft account(first gmail account is created). In the previous version (3.0.1) the provider was Google and now the provider is Microsoft (claims.Current.OriginalIssuer). The username(urn:microsoftaccount:name) in this case is not filled though the firstname and lastname are set in the Microsoft account: 2017-06-20T06:37:53 PID[9784] Information http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier c8XXXXXXXXXXX Is there |
Could someone please clarify where I should be extracting the |
I do not know if following is the correct way of doing it, but it works for us. We just wanted the email address var ms = new MicrosoftAccountAuthenticationOptions |
Thanks @ShenglinGuo |
Facing same issue here 😞 |
Turns out I had missed that the API has been updated (and v3.1 must use that updated version). Once I signed up for a new app account (https://apps.dev.microsoft.com) then it worked for me, with the workaround (haven't tried without). |
@psillar it may work for you if you're not trying to extract email information, that part doesn't work. |
Oh, with the workaround it works for me - I get the email information that way or am I missing something? |
Hi @psillar, I just tried it but it's not working for me, just to be sure, can you go to your bin folder and locate Microsoft.Owin.dll then right click it --> properties --> details --> file version - do you have 3.1.60405.82 ? |
Hi @YovavGad, yes that's the version I'm using. I do the email capture a bit differently, however:
|
This is what I was trying but my email comes out empty... |
Ok, when I created the app credentials in apps.dev.microsoft.com I selected the 'email' Delegated Permission under Microsoft Graph Permissions. I'm not sure if that makes a difference? |
So, what's the deal with this? I'm having some trouble making this work at the moment - my request is being sent back to path /#error=access_denied. This seems to happen after the execution of the OAuthAuthorizationServerProvider library where I call context.Validated(), but before it ever hits my WebApi code. I tried the OnAuthorized function as suggested by psillar and ShenglinGuo, but it doesn't seem to ever get called. EDIT: Problem ended up being, ultimately, that I had to request User.Read, openid, email, and pull the email from that userPrincipalName, like psillar and ShenglinGuo suggested. Took downloading, compiling, and debugging into source to work that one out, but confirmed working on my app using the 3.1 version of the code/Nuget. |
Hi @Tratcher This issue is still reproducible after update the Microsoft.Owin.Security.MicrosoftAccount package of my visual studio project to v4.0.0-alpha1. Do you think that we should open other issue for tracking it? Here are more details about this issue: Thanks in advance, |
I have open the new issue #112 for tracking it. |
What is the uaid? |
I understand Microsoft updated their APIs recently, I created a new app at https://apps.dev.microsoft.com
I know that before it was not possible to test on localhost, this is tested live on UFOToday.com, but I keep getting "access denied",
response_type=code seems suspicious, I would think code maybe replaced with something else (not sure) see https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-scopes#using-permissions
I noticed that the name of the scope changed from wl.emails wl.birthday, so I'm just trying with what I saw in the example code "openid email profile" (otherwise it's breaking)
My code:
This is what I'm getting:
Does it work for anyone else?
The text was updated successfully, but these errors were encountered: