protected override async Task <ITransitionResult> ExecuteInternalAsync(TransitionInput <JwtContainer> input, CacheItem relatedItem) { var userData = _jwtService.GetDataFromJwt <UserIdentitiesData>(input.Data.Jwt).Data; relatedItem.AuthCookieType = CookieType.Passcode; await _savePartialConnectionCommand.ExecuteAsync(userData, relatedItem); await _userHandlerAdapter.UpgradeConnectionAsync(userData.PublicKey, new OwnIdConnection { AuthType = ConnectionAuthType.Passcode, PublicKey = userData.PublicKey, RecoveryData = userData.RecoveryData, RecoveryToken = relatedItem.RecoveryToken }); var composeInfo = new BaseJwtComposeInfo(input) { Behavior = GetNextBehaviorFunc(input, relatedItem) }; var jwt = JwtComposer.GenerateFinalStepJwt(composeInfo); return(new StateResult(jwt, _cookieService.CreateAuthCookies(relatedItem))); }
protected override Task <ITransitionResult> ExecuteInternalAsync(TransitionInput input, CacheItem relatedItem) { var composeInfo = new BaseJwtComposeInfo(input); string jwt; if (relatedItem.Status == CacheItemStatus.Approved) { composeInfo.Behavior = GetNextBehaviorFunc(input, relatedItem); jwt = JwtComposer.GenerateBaseStepJwt(composeInfo); } else { composeInfo.Behavior = new FrontendBehavior { Type = StepType.Declined, ChallengeType = relatedItem.ChallengeType, ActionType = ActionType.Finish }; jwt = JwtComposer.GenerateFinalStepJwt(composeInfo); } return(Task.FromResult(new GetApprovalStatusResponse(jwt, relatedItem.Status) as ITransitionResult)); }
protected override async Task <ITransitionResult> ExecuteInternalAsync(TransitionInput input, CacheItem relatedItem) { await _stopFlowCommand.ExecuteAsync(input.Context, "Error_UserCanceledAuth"); var composeInfo = new BaseJwtComposeInfo(input) { Behavior = GetNextBehaviorFunc(input, relatedItem), }; return(new JwtContainer(JwtComposer.GenerateFinalStepJwt(composeInfo))); }
protected override async Task<ITransitionResult> ExecuteInternalAsync(TransitionInput<JwtContainer> input, CacheItem relatedItem) { relatedItem = await _linkAccountCommand.ExecuteAsync(input.Data, relatedItem); var composeInfo = new BaseJwtComposeInfo(input) { Behavior = GetNextBehaviorFunc(input, relatedItem), }; // TODO: change to generic step generation var jwt = JwtComposer.GenerateFinalStepJwt(composeInfo); return new StateResult(jwt, _cookieService.CreateAuthCookies(relatedItem)); }
private async Task <ITransitionResult> FinishAuthProcessAsync(UserIdentitiesData userData, CacheItem relatedItem, TransitionInput <JwtContainer> input) { await _savePartialConnectionCommand.ExecuteAsync(userData, relatedItem); var composeInfo = new BaseJwtComposeInfo(input) { Behavior = FrontendBehavior.CreateSuccessFinish(relatedItem.ChallengeType) }; var jwt = JwtComposer.GenerateFinalStepJwt(composeInfo); return(new StateResult(jwt, _cookieService.CreateAuthCookies(relatedItem))); }
protected override async Task <ITransitionResult> ExecuteInternalAsync(TransitionInput <JwtContainer> input, CacheItem relatedItem) { var userData = _jwtService.GetDataFromJwt <UserIdentitiesData>(input.Data.Jwt).Data; await _savePartialConnectionCommand.ExecuteAsync(userData, relatedItem); var composeInfo = new BaseJwtComposeInfo(input) { Behavior = GetNextBehaviorFunc(input, relatedItem), }; var jwt = JwtComposer.GenerateFinalStepJwt(composeInfo); return(new StateResult(jwt, _cookieService.CreateAuthCookies(relatedItem))); }