Hello All implementing basic office 365 integration to contacts from a rails application. I have already connected with google using omniauth-google-oauth2 and google-api-client. I am following https://learn.microsoft.com/en-us/outlook/rest/ruby-tutorial for app setup and am using the strategy omniauth-office365 as I did previously. It appears I have all setup right but when I authenticate I get the following error :
I have my settings in accordance to the docs, I dont know what I am missing..
The basic usage at this moment is just to authenticate which I have added the code below to omniauth.rb:
`
Rails.application.config.middleware.use OmniAuth::Builder do
provider :office365, '$myid', '$mykey',
{:scope => 'mail.read, User.read, profile,openid'}
end
I added a route to my routes.rb:
get 'auth/:provider/callback', to: 'contacts#contact_integrations'
get 'auth/failure', to: redirect('/')
In my controller I added :
def contact_integrations
access_token = request.env["omniauth.auth"]
end
In a view I added a link to :
<%= link_to 'Outlook', "/auth/office365" %>
I did the above method with google and it worked fine, of course I added more code to get what I needed from the API but the upfront authentication was obtained. If I click the link I get the expected login/authenticate screens from office365, but it returns the permissions error shown in the image even though it is set to be able to access all accounts.