Я пытаюсь получить токен авторизации от Azure AD через библиотеку DotNetOpenAuth. Я не хочу использовать ADAL, потому что у меня огромный проект в .net 3.5, а ADAL не поддерживает .net 3.5 (only .net> 4). Однако я не могу заставить его работать с Azure AD. Я не знаю, что настроить. До сих пор это то, что у меня есть:Получение токена авторизации от Azure AD с 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();
}
Проблема в том, что я не знаю, что разместить здесь. Я не знаю, какие значения следует размещать здесь:
AuthorizationEndpoint = новый Uri ("" /* ЧТО ПОСТАВИТЬ ЗДЕСЬ */),
TokenEndpoint = новый Uri ("" /* ЧТО PUT ЗДЕСЬ */)