1

I'm trying to do Oauth2 login with Azure AD. I've tried these two URLs

and these lead to a login page. After I enter my email and password, I am redirected to https://login.microsoftonline.com/common/federation/oauth2 with these errors

Sorry, but we’re having trouble signing you in. We received a bad request.

Additional technical information: Correlation ID: 886be244-da75-419d-97b4-0e309473ce9e Timestamp: 2017-11-19 17:47:26Z

AADSTS50020: We are unable to issue tokens from this api version for a Microsoft account. Please contact the application vendor as they need to use version 2.0 of the protocol to support this.

I checked my server logs, and the Azure servers haven't even tried to contact me after the login page.

Any ideas how I figure out what the problem is?

Community
  • 1
  • 1
new name
  • 15,861
  • 19
  • 68
  • 114
  • 1
    Maybe you registered your app as a v2 app in apps.dev.microsoft.com and then tried to use v1 endpoints? – juunas Nov 19 '17 at 18:18

1 Answers1

1

Microsoft's documentation is insanely frustrating, but I think I've figured out the issue.

I believe that if you are registering a new app to use any Oauth2 services, you can only register an app to use the v2.0 protocol. I searched extensively, and I was not able to figure out how to register an app to use the older v1.0 protocol.

Despite this, much of the documentation still relates to the v1.0 protocol, some of the documentation states that the v1.0 protocol is recommended in certain situations even though you can no longer register an app for it.

Anyway, here is a summary:

  • v1.0 protocols have a link like this: /common/oauth2/authorize
  • v2.0 protocols have a link like this: /common/oauth2/v2.0/authorize

If you register a new app (at https://apps.dev.microsoft.com/#/appList) then ignore all documentation relating to the v1.0 protocol because you apparently can't use it.

new name
  • 15,861
  • 19
  • 68
  • 114
  • Hi Jeff, sorry about your experience with the docs. You can register an app for the v1.0 protocol using the [Azure portal](https://portal.azure.com). It's touched on in this doc: [registering a v1.0 app](https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications). – Daniel Dobalian Nov 29 '17 at 18:49