Exemplo n.º 1
0
        /// <summary>
        /// Returns true if token has access to specified service.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <bool> VerifyAccess(VerifyTokenRequest request)
        {
            if (string.IsNullOrEmpty(request.Service))
            {
                throw new ArgumentNullException("request.Service");
            }

            VerifyTokenResponse result = await this.tokenDataProvider.VerifyToken(request);

            return(result != null && result.Allowed);
        }
Exemplo n.º 2
0
 StateMachine.State StateVerified(VerifyTokenResponse verifyTokenResponse)
 {
     return(() =>
     {
         if (sm.EnterState)
         {
             Name = verifyTokenResponse.team_name;
             status = ConnectionStatus.connected;
             Logic.Notify($"Connected to GhostVR team {Name}");
             sm.SwitchState(StateConnected);
         }
     });
 }