Beispiel #1
0
        public async Task <List <TokenExchangeResponse> > ProcessExchangeAsync(
            string tokenScheme,
            TokenExchangeRequest tokenExchangeRequest)
        {
            if (MapTokenExchangeHandlers.ContainsKey(tokenScheme))
            {
                var response =
                    await MapTokenExchangeHandlers[tokenScheme]
                    .ProcessExchangeAsync(tokenExchangeRequest);
                return(response);
            }

            throw new Exception($"{tokenScheme} is not mapped to an ITokenExchangeHandler");
        }
Beispiel #2
0
 public Task <bool> TokenExchangeHandlerExistsAsync(string tokenScheme)
 {
     return(Task.FromResult(MapTokenExchangeHandlers.ContainsKey(tokenScheme)));
 }