I am writing a Xamarin.Forms app that uses ADAL to authenticate with.
I am using ADFS for authentication and am only worried about the Android client right now. My problem is, whenever I invoke the AcquireTokenAsync, I get the login screen but with no content.
I have already proved out getting a token from ADFS using postman and had no issues.
My code (I am just trying to prove this out right now, I don't really care about the implementation):
string authority = "adfs_url";
string resourceURI = "myidentity";
string clientID = "123-123-123";
string clientReturnURI = "somelocalhost";
var authContext = new AuthenticationContext(authority,false);
Task.Run(async () =>
{
var authResultAsync = await authContext.AcquireTokenAsync(resourceURI, clientID, new Uri(clientReturnURI), PlatformParameters);
});
My platform parameters are being set in the Page Renderer
protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
{
base.OnElementChanged(e);
this.page = e.NewElement as MainPage;
this.page.PlatformParameters = new PlatformParameters(this.Context as Activity);
}
The only lead I have is I get this in my console output
Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
And I also get this, but it seems to be a red herring (some blog post said with just shows up on Android N devices which is the sdk level I am using)
Rejecting re-init on previously-failed class java.lang.Class: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/TracingController;
Any help on this would be great appreciated, I have really been banging my head against it for a couple of days.