Ejemplo n.º 1
0
        public override async Task <ValidateIdentityResponse> ValidateIdentity(ValidateIdentityRequest request, ServerCallContext context)
        {
            var authorization = registry.Authorize(request.Key, request.Passcode);

            if (authorization != null)
            {
                return(new ValidateIdentityResponse {
                    SessionToken = authorization.Key
                });
            }
            throw new RpcException(new Status(StatusCode.PermissionDenied, "Key and password pair invalid."));
        }