Пример #1
0
        private void AuthenticateToServer(Fido2AuthenticationResponse fido2AuthenticationResponse)
        {
            string Tag = "AuthenticateToServer";

            if (!fido2AuthenticationResponse.IsSuccess)
            {
                log.Error(Tag, GetString(Resource.String.authn_fail), fido2AuthenticationResponse);
                return;
            }

            IFidoServer fidoServer = new FidoServerSimulator();

            if (fidoServer == null)
            {
                log.Error(Tag, GetString(Resource.String.connect_server_err));
                return;
            }

            ServerAssertionResultRequest request = ServerUtils.ConvertToServerAssertionResultRequest(fido2AuthenticationResponse.AuthenticatorAssertionResponse);

            ServerResponse response = fidoServer.GetAssertionResult(request);

            if (!ServerStatus.Ok.Equals(response.GetStatus()))
            {
                log.Error(Tag, GetString(Resource.String.authn_fail) + response.GetErrorMessage());
                return;
            }
            Log.Info(Tag, GetString(Resource.String.authn_success));
        }