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)));
        }
예제 #2
0
        protected override async Task <CacheItem> ProcessFido2RegisterResponseAsync(CacheItem relatedItem,
                                                                                    string publicKey, uint signatureCounter, string credentialId)
        {
            await _userHandlerAdapter.UpgradeConnectionAsync(relatedItem.OldPublicKey, new OwnIdConnection
            {
                PublicKey             = publicKey,
                Fido2CredentialId     = credentialId,
                Fido2SignatureCounter = signatureCounter.ToString(),
                AuthType = ConnectionAuthType.Fido2
            });

            return(await base.ProcessFido2RegisterResponseAsync(relatedItem, publicKey, signatureCounter, credentialId));
        }