oauth-2.0microsoft-accountwindows-live-id

What has changed in Microsoft oAuth 2.0 implementation?


I have a web site that has been using Microsoft accounts for authentication for more than three years. It is a Node web app and is using the passport-windowslive package.

Lately, when users return from login.live.com after logging successfully using their Microsoft accounts, one of two types of errors is received, sometimes:

The provided value for the input parameter 'scope' is not valid. The target '«my web site domain»' does not exist.

or:

The provided value for the 'code' value is not valid. The code has expired.

The error is sporadic. I am unable to reproduce it on my development machine.

As the passport-windowslive package was last changed four years ago and my code has not changed for more than two years, the cause looks like it's at the Microsoft end. What has changed?


Update: The problem is getting worse. Previously, the problem could sometimes be overcome by using an incognito browser session or changing the browser. Now it's happening on all browsers. But I am still unable to reproduce the error when running on localhost (with no http).


Solution

  • Microsoft has changed how its applications can be used for oAuth. They must now be managed from Azure instead of apps.dev.microsoft.com or Microsoft Live.

    Existing applications configured in apps.dev.microsoft.com will result in:

    AADSTS700016: Application with identifier '000000xxxxxxx' was not found in the directory 'aaaaaaaa-bbbb-cccc-ddd-eeeeeeeeeeee'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.

    The passport-windowslive module somehow did not bubble up the error response.