0
我正尝试使用ADFS和oauth2来验证我的应用程序。我发现了很多文档可以用azure服务(使用ADAL)来完成此操作。但是没有关于如何使用本地服务器的信息。Xamarin:创建没有天蓝色的ADFS(Oauth2)客户端
我测试了一个角度的应用程序下的所有信息和认证工程!
public class AuthenticationService
{
public static string clientId = "uri:tst-amdm-website.mycompany.be";
private static string commonAuthority = "https://claim.mycompany.be/";
public static Uri returnUri = new Uri("http://www.google.be");
const string graphResourceUri = "uri:tst-amdm-api.mycompany.be";
public async void GetAccessToken(IPlatformParameters platformParameters)
{
AuthenticationResult authResult = null;
JObject jResult = null;
//List<User> results = new List<User>();
try
{
AuthenticationContext authContext = new AuthenticationContext(commonAuthority);
if (authContext.TokenCache.ReadItems().Any())
authContext = new AuthenticationContext(authContext.TokenCache.ReadItems().First().Authority);
authResult = await authContext.AcquireTokenAsync(graphResourceUri, clientId, returnUri, platformParameters);
var test = authResult.AccessToken;
}
catch (Exception ee)
{
//results.Add(new User { error = ee.Message });
//return results;
}
}
}
这是我得到的错误,但在角度这个网址:https://claim.mycompany.be/
完美的作品。
'authority' Uri should have at least one segment in the path (i.e. https://<host>/<path>/...)