{"action":"closed","issue":{"url":"https://api.github.com/repos/murbanski/omniauth-microsoft-office365/issues/4","repository_url":"https://api.github.com/repos/murbanski/omniauth-microsoft-office365","labels_url":"https://api.github.com/repos/murbanski/omniauth-microsoft-office365/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/murbanski/omniauth-microsoft-office365/issues/4/comments","events_url":"https://api.github.com/repos/murbanski/omniauth-microsoft-office365/issues/4/events","html_url":"https://github.com/murbanski/omniauth-microsoft-office365/issues/4","id":149834771,"number":4,"title":"Authentication Failure - Application is not supported for this API version","user":{"login":"jharbert","id":753580,"avatar_url":"https://avatars.githubusercontent.com/u/753580?v=3","gravatar_id":"","url":"https://api.github.com/users/jharbert","html_url":"https://github.com/jharbert","followers_url":"https://api.github.com/users/jharbert/followers","following_url":"https://api.github.com/users/jharbert/following{/other_user}","gists_url":"https://api.github.com/users/jharbert/gists{/gist_id}","starred_url":"https://api.github.com/users/jharbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jharbert/subscriptions","organizations_url":"https://api.github.com/users/jharbert/orgs","repos_url":"https://api.github.com/users/jharbert/repos","events_url":"https://api.github.com/users/jharbert/events{/privacy}","received_events_url":"https://api.github.com/users/jharbert/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-20T17:29:34Z","updated_at":"2016-04-20T22:45:53Z","closed_at":"2016-04-20T22:45:53Z","body":"Hi guys,\r\n\r\nWondering if you have seen an issue giving an `unauthorized_client` error, saying `AADSTS70001: Application '<client_id>' is not supported for this API version.`\r\n\r\nMy callback URLs are set up correctly, but upon successful authentication on Azure I'm redirected back and receive the error.\r\n\r\n```\r\nE, [2016-04-20T10:06:57.658856 #90049] ERROR -- omniauth: (microsoft_office365) Authentication failure! unauthorized_client: OmniAuth::Strategies::OAuth2::CallbackError, unauthorized_client | AADSTS70001: Application 'xxxxx-xxxxx-xxxxx-xxxxx' is not supported for this API version\r\n```\r\n\r\nAs some background, I've been able to successfully authenticate using Microsoft's example Rails app (https://github.com/OfficeDev/O365-Ruby-Microsoft-Graph-Connect) that uses the [omniauth-azure-activedirectory](https://github.com/AzureAD/omniauth-azure-activedirectory) gem.  It may be worth noting for someone that their example app [skips the authentication token verification](https://github.com/OfficeDev/O365-Ruby-Microsoft-Graph-Connect/blob/master/app/controllers/pages_controller.rb#L15) and instead does it manually.  It fails otherwise.\r\n\r\nSo, I know to some extent logging in works, but I can't seem to get this gem working.  If it helps, the URL that I am taken to upon clicking the login link is:\r\n\r\n```\r\nhttps://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=xxxxx-xxxxx-xxxxx-xxxxx&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fauth%2Fmicrosoft_office365%2Fcallback&response_type=code&scope=openid+email+profile+https%3A%2F%2Foutlook.office.com%2Fcontacts.read&state=a910eb04594c40933bb3585fba9036fa6176294c18b82f86\r\n```\r\n\r\nMy provider is defined in my devise initializer (along with my other working social providers):\r\n\r\n```config.omniauth :microsoft_office365, ENV['OFFICE365_KEY'], ENV['OFFICE365_SECRET']```"}}