For the company we use Xamarinin conjunction with ADAL.NETto access the web-api that is connected to Azure Active Directory. When a user logs in, he is working fine. However, when we are inside the companyβs network, we get a response 404when we are redirected to the appropriate server ADFS.
After some research, we learned that the company uses two different servers to enter the system. One for handling internal requests and one for off-network traffic.
So, we use the emulator to test the application. We changed the file hoststo a redirect to an external server that launched the login. (We redirected adfs.******.nlto IPan external server.)
Now the question is: how do I fix this in our application? The company does not want to change its redirects, as it will break more applications, such as Sharepoint and others.
I read something about this:
https://github.com/AzureAD/azure-activedirectory-library-for-dotnet/wiki/ADAL-.NET-Q-&-A#why-does-adal-for-windows -store-fails-when-in-corporate-network-while-it-succeeds-otherwise
But this is only for Windows.
This is how we execute the current request:
public static async Task<string> Login()
{
AuthenticationContext authContext = new AuthenticationContext(_authority);
authContext.TokenCache.Clear();
return (await authContext.AcquireTokenAsync(_resourceId, _clientId, _redirect, PlatformParameters)).AccessToken;
}
source
share