Beispiel #1
0
        protected ValidateAuthenticationTokenResponce ValidateAuthenticationToken(ValidateAuthenticationTokenRequest request)
        {
            ValidateAuthenticationTokenResponce responce = new ValidateAuthenticationTokenResponce();

            responce.OK       = false;
            responce.Responce = "Invalid";

            string tokenSalt = DB.GetTokenSaltFromUID(request.UserID);

            var crypto = Encryption.BuildCrypto(tokenSalt);

            if (ValidateAuthToken(request.UserID, request.Token, crypto))
            {
                responce.OK       = true;
                responce.Responce = "Valid";
            }

            return(responce);
        }
Beispiel #2
0
        private static void ValidateAuthTokenReceived(object sender, JsonClient.JsonMessageResponceArgs e)
        {
            ValidateAuthenticationTokenResponce responce = e.ResponceMessage as ValidateAuthenticationTokenResponce;

            if (responce == null)
            {
                Console.WriteLine("Invalid responce" + e.ResponceMessage.MessageName);
            }
            else
            {
                if (responce.OK)
                {
                    Console.WriteLine("Auth Token Validation OK");
                    Console.WriteLine(responce.Responce);
                }
                else
                {
                    Console.WriteLine("Auth Token Validation Failed");
                    Console.WriteLine(responce.Responce);
                }
            }

            ClearWait();
        }