public async Task <DiscoveryDocument> GetDiscoveryDocument(IdentityProviderEntity identityProvider)
        {
            return(await _dataCache.GetDataAsync(identityProvider.ClientId, async() =>
            {
                var response = await _httpClient.GetAsync(identityProvider.DiscoveryUrl);

                var content = await response.Content.ReadAsStringAsync();
                return JsonConvert.DeserializeObject <DiscoveryDocument>(content);
            }));
        }
Beispiel #2
0
 public static IdentityProviderModel ToClientModel(this IdentityProviderEntity entity, DiscoveryDocument discoveryDocument)
 {
     return(new IdentityProviderModel
     {
         ClientId = entity.ClientId,
         DisplayName = entity.DisplayName,
         IconUrl = entity.IconUrl,
         AuthorizeUrl = discoveryDocument.AuthorizationEndpoint
     });
 }