Ich versuche, Autorisierungstoken von Azure AD über die DotNetOpenAuth-Bibliothek abzurufen. Ich möchte ADAL nicht verwenden, weil ich ein riesiges Projekt in .net 3.5 habe und ADAL .net 3.5 nicht unterstützt (nur .net> 4). Allerdings kann ich es nicht ganz mit Azure AD arbeiten. Ich weiß nicht, was ich konfigurieren soll. So weit, das ist was ich habe:Erhalten von Autorisierungstoken aus Azure AD mit Dotnetopenauth
private static WebServerClient _webServerClient;
private static string _accessToken;
// Client ID (as obtained from Azure AD portal)
private static string clientId = "here goes my client id guid";
// Client Secret (as obtained from Azure AD portal)
private static string appKey = "here goes my secret";
private static string aadInstance = "https://login.microsoftonline.com/{0}";
private static string tenant = "mytenant.domain.com";
private static string authority = string.Format(CultureInfo.InvariantCulture, aadInstance, tenant);
// Azure AD resource I am trying to access
private static string serviceResourceId = "https://mytenant.domain.com/protectedresource";
private static void InitializeWebServerClient()
{
var authorizationServer = new AuthorizationServerDescription
{
AuthorizationEndpoint = new Uri(""/* WHAT TO PUT HERE */),
TokenEndpoint = new Uri(""/* WHAT TO PUT HERE */)
};
_webServerClient = new WebServerClient(authorizationServer, clientId, appKey);
}
private static void RequestToken()
{
var state = _webServerClient.GetClientAccessToken();
_accessToken = state.AccessToken;
}
static void Main(string[] args) {
InitializeWebServerClient();
RequestToken();
}
Das Problem ist, ich weiß nicht, was ich hier platzieren soll. Ich weiß nicht, welche Werte stelle ich hier sollte:
AuthorizationEndpoint = new Uri ("" /* WAS HIER ZU SETZEN */),
TokenEndpoint = new Uri ("" /* WAS ZU PUT HERE */)