Microsoft identity platform fails to authenticate personal Microsoft accounts with Office 365 subscr

%3CLINGO-SUB%20id%3D%22lingo-sub-2156250%22%20slang%3D%22en-US%22%3EMicrosoft%20identity%20platform%20fails%20to%20authenticate%20personal%20Microsoft%20accounts%20with%20Office%20365%20subscr%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2156250%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20This%20is%20my%20first%20posting%20here%20so%20apologies%20if%20I%20am%20breaking%20any%20blog%20rules%20unknowingly.%3C%2FP%3E%3CP%20class%3D%22%22%3EI%20registered%20an%20office%20add-in%20app%20in%20Azure%20portal.%20The%20add-in%20uses%20single%20sign-on%20(SSO)%20to%20authorize%20users.%20I%20obtain%20an%20authorization%20code%20from%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fv2.0%2Fauthorize%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fv2.0%2Fauthorize%26nbsp%3B%3C%2FA%3E%20then%20redeem%20it%20for%20an%20access%20token%20with%20a%20post%20to%20%3CA%20href%3D%22https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fv2.0%2Ftoken%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fv2.0%2Ftoken%3C%2FA%3E.%20The%20SSO%20works%20for%20users%20with%20work%20or%20school%20accounts%20but%20fails%20for%20users%20with%20personal%20email%20accounts%20such%20as%20live.com%20and%20hotmail.com%20despite%20having%20current%20personal%20office%20365%20subscription.%26nbsp%3B%20Here%20is%20a%20typical%20response%20received%20from%20the%20token%20server%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%22error%22%3A%22invalid_grant%22%2C%22error_description%22%3A%22AADSTS9002313%3A%20Invalid%20request.%20Request%20is%20malformed%20or%20invalid.%5Cr%5CnTrace%20ID%3A%20f351e59c-dc4f-4b10-8293-4e6fe8c8c600%5Cr%5CnCorrelation%20ID%3A%20196c96ec-1310-4afb-8d4b-ab70d77bb816%5Cr%5CnTimestamp%3A%202021-02-22%2000%3A34%3A40Z%22%2C%22error_codes%22%3A%5B9002313%5D%2C%22timestamp%22%3A%222021-02-22%2000%3A34%3A40Z%22%2C%22trace_id%22%3A%22f351e59c-dc4f-4b10-8293-4e6fe8c8c600%22%2C%22correlation_id%22%3A%22196c96ec-1310-4afb-8d4b-ab70d77bb816%22%2C%22error_uri%22%3A%22%3CA%20href%3D%22https%3A%2F%2Flogin.microsoftonline.com%2Ferror%3Fcode%3D9002313%26quot%3B%7D%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Flogin.microsoftonline.com%2Ferror%3Fcode%3D9002313%22%7D%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsers%20have%20sent%20us%20proofs%20of%20their%20valid%20personal%20office%20365%20subscriptions%20but%20still%20cannot%20use%20SSO.%20The%20App%20is%20configured%20in%20Azure%20portal%20to%20support%20Accounts%20in%20any%20organizational%20directory%20(Any%20Azure%20AD%20directory%20-%20Multitenant)%20and%20personal%20Microsoft%20accounts%20(e.g.%20Skype%2C%20Xbox).%20It%20seems%20to%20me%20Microsoft%20identity%20platform%20does%20not%20recognize%20some%20personal%20Microsoft%20accounts%20and%20I%20am%26nbsp%3B%20not%20sure%20how%20to%20resolve%20the%20error%20from%20our%20end%20or%20if%20there%20is%20any%26nbsp%3B%20thing%20users%20could%20do%20to%20refresh%20their%20accounts%20with%20Microsoft%20identity%20platform.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20issue%20is%20been%20blocking%20for%20many%20users%20so%20any%20help%20to%20understand%20and%20resolve%20this%20error%20is%20greatly%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2156250%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Active%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIdentity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi, This is my first posting here so apologies if I am breaking any blog rules unknowingly.

I registered an office add-in app in Azure portal. The add-in uses single sign-on (SSO) to authorize users. I obtain an authorization code from https://login.microsoftonline.com/common/oauth2/v2.0/authorize  then redeem it for an access token with a post to https://login.microsoftonline.com/common/oauth2/v2.0/token. The SSO works for users with work or school accounts but fails for users with personal email accounts such as live.com and hotmail.com despite having current personal office 365 subscription.  Here is a typical response received from the token server: 

 

{"error":"invalid_grant","error_description":"AADSTS9002313: Invalid request. Request is malformed or invalid.\r\nTrace ID: f351e59c-dc4f-4b10-8293-4e6fe8c8c600\r\nCorrelation ID: 196c96ec-1310-4afb-8d4b-ab70d77bb816\r\nTimestamp: 2021-02-22 00:34:40Z","error_codes":[9002313],"timestamp":"2021-02-22 00:34:40Z","trace_id":"f351e59c-dc4f-4b10-8293-4e6fe8c8c600","correlation_id":"196c96ec-1310-4afb-8d4b-ab70d77bb816","error_uri":"https://login.microsoftonline.com/error?code=9002313"} 

 

Users have sent us proofs of their valid personal office 365 subscriptions but still cannot use SSO. The App is configured in Azure portal to support Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox). It seems to me Microsoft identity platform does not recognize some personal Microsoft accounts and I am  not sure how to resolve the error from our end or if there is any  thing users could do to refresh their accounts with Microsoft identity platform.

 

This issue is been blocking for many users so any help to understand and resolve this error is greatly appreciated.

 

1 Reply

I did figure out the error eventually. The auth. code should be decoded before redeeming. Some codes apparently did not require decoding while others did. Hopefully this will help someone who might run into this problem. I wish the server response was a bit more verbose about what was malformed.