public async void ValidateIfGeneratedAuthCodeIsStored() { var authCode = await _AuthCodeService.GenerateAuthCodeAsync(new ClaimsPrincipal()); var result = await _AuthCodeService.GetClaimsByAuthCodeAsync(authCode); Assert.NotNull(result); }
public async Task <IActionResult> ExecuteAsync(HttpContext httpContext) { if (httpContext == null) { throw new ArgumentNullException(nameof(httpContext)); } _logger.WriteRedirecting(httpContext.Request.Host.ToString()); // check httpContext claims on AccessToken validity if (!await _theIdentityHubService.VerifyClaimTokenAsync(httpContext.User.Claims)) { await _logoutCommand.ExecuteAsync(httpContext); return(new RedirectResult(httpContext.Request.Path)); // redirect to {prefix}/Auth/Redirect to trigger login } var authorizationCode = await _authCodeService.GenerateAuthCodeAsync(httpContext.User); return(new RedirectResult(_configuration.FrontendBaseUrl + "/auth/callback?code=" + authorizationCode)); }