public KinlyPlatformService(HttpClient httpClient, ICustomJwtTokenProvider customJwtTokenProvider, string kinlySelfTestScoreEndpointUrl) { _httpClient = httpClient; _customJwtTokenProvider = customJwtTokenProvider; _kinlySelfTestScoreEndpointUrl = kinlySelfTestScoreEndpointUrl; }
private static IKinlyPlatformService BuildKinlyPlatformService(HttpClient httpClient, ICustomJwtTokenProvider customJwtTokenProvider, ServiceSettings serviceSettings) { var service = new KinlyPlatformService(httpClient, customJwtTokenProvider, serviceSettings.KinlySelfTestScoreEndpointUrl); return(service); }
public TokenController(IHashGenerator hashGenerator, ICustomJwtTokenProvider customJwtTokenProvider, KinlyConfiguration kinlyConfiguration) { _hashGenerator = hashGenerator; _customJwtTokenProvider = customJwtTokenProvider; _kinlyConfiguration = kinlyConfiguration; }
public void Setup() { var secretKey = "6t8obpbl0iHOSvDpnUImSdZjYEpTcaEWC8SzLO4/X6iOHArHEm/3Ja6NnzaKS6JwE3U/Bjy1LE/bARMqNCN98w=="; var customTokenSettings = new KinlyConfiguration { ApiSecret = secretKey, Audience = Audience, Issuer = Issuer }; _customJwtTokenProvider = new CustomJwtTokenProvider(customTokenSettings); _customJwtTokenHandler = new CustomJwtTokenHandler(customTokenSettings); }
public void Should_be_invalid_token_when_token_generated_with_different_secret() { var secretKey = "F8pf/zwOgm/kASEFs+BKRDdyq+RhHCQ9i9tPjeaPjUebm6HvzXKIsr/nX28wpwAZoWRG0FQK9LVf6nrkW/vg4w=="; var customTokenSettings = new KinlyConfiguration { ApiSecret = secretKey, Audience = Audience, Issuer = Issuer }; _customJwtTokenProvider = new CustomJwtTokenProvider(customTokenSettings); var token = _customJwtTokenProvider.GenerateApiToken("Test User", 1); var claimsPrincipal = _customJwtTokenHandler.IsValidToken(token); claimsPrincipal.Should().BeFalse(); }
public KinlyPlatformService(ICustomJwtTokenProvider customJwtTokenProvider, string kinlySelfTestScoreEndpointUrl) { _customJwtTokenProvider = customJwtTokenProvider; _kinlySelfTestScoreEndpointUrl = kinlySelfTestScoreEndpointUrl; }
public KinlyApiTokenDelegatingHandler(ICustomJwtTokenProvider tokenProvider) { _tokenProvider = tokenProvider; }
public KinlySelfTestApiDelegatingHandler(ICustomJwtTokenProvider tokenProvider) { _tokenProvider = tokenProvider; }