I have run into issues the last couple of days trying to get the Xamarin.Auth library to work with my WebAPI and Active Directory. For the life of me, I can't get our API to work with Xamarin.Auth but I can log in through a browser and view our JSON data. I'm using Joe Suave's example as a starter.
Our URL structure is like this: https://####.azurewebsites.net/api/web*
The default URL in AD and the WebAPI: https://####.azurewebsites.net/
My reply URLs in AD are as follows:
Based upon the Joe Suave Example, I have set OAuthSettings as follows:
ClientId: "Assigned Web App Client ID in AD"
AuthorizeURL: "https://login.microsoftonline.com/[Our AD TenantID GUID]/oauth2/authorize"
Scope: string.Empty // Should this be our api/web* calls?
RedirectURL: [One of the above redirects]
These settings get me to the Microsoft Login Page. I log in and I'm given an error that either the data returned is forged or the Resource was not returned.
I'm unable to get the proper authentication data to return and call my api/web*.
Using the */aad/callback reply URL results in 'Expected access_token in response, but did not receive one.'
Using the */api/webgreeks reply URL results in 'Invalid state from server. Possible forgery!'
I tried to retrieve the actual AAD###### error but it disappears way too quickly. The app is being run in iPhone 6 10.2 simulator on an iMac. Are there any tools I can be running to capture the returned data better? Edit: I actually did retrieve it: AADSTS50001 Resource Identifier not provided. Could this be my answer?
Any ideas on what I might be doing wrong?