public JwtTokenValidation(IConfiguration configuration, GoogleDiscoverCacheContainer googleDiscoverCacheContainer, NortonDiscoverCacheContainer nortonDiscoverCacheContainer) { _configuration = configuration; // we probably don't want to check for the client_id. We are only interested in the fact that the authority issued the jwt. _nortonProviderValidator = new ProviderValidator(nortonDiscoverCacheContainer, null); _googleProviderValidator = new ProviderValidator(googleDiscoverCacheContainer, null); }
public async Task <ClaimsPrincipal> ValidateToken(string provider, string idToken) { ProviderValidator providerValidator = null; switch (provider) { case "google-id_token": providerValidator = _googleProviderValidator; break; case "norton-id_token": providerValidator = _nortonProviderValidator; break; } var cp = await providerValidator.ValidateToken(idToken); return(cp); }