Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            String token = "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48UmVzcG9uc2UgeG1sbnM6eHNkPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgSUQ9Il8xMWNkZjFiZS0xZGNiLTQ0OWUtOWVmOS1mOTFjZTM2MWIxZDAiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDIwLTA3LTE5VDIzOjE1OjIyLjMwNjE5MzRaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9hcGkuYml0YXIuaXMvYWNjb3VudC9pc2xhbmQiIHhtbG5zPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiPjxJc3N1ZXIgeG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iPklubnNrcmFuaW5nPC9Jc3N1ZXI+PFNpZ25hdHVyZSB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyI+PFNpZ25lZEluZm8+PENhbm9uaWNhbGl6YXRpb25NZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy14bWwtYzE0bi0yMDAxMDMxNSIgLz48U2lnbmF0dXJlTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnI3JzYS1zaGExIiAvPjxSZWZlcmVuY2UgVVJJPSIiPjxUcmFuc2Zvcm1zPjxUcmFuc2Zvcm0gQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjZW52ZWxvcGVkLXNpZ25hdHVyZSIgLz48VHJh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WUgeHNpOnR5cGU9InhzZDpzdHJpbmciPk1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7IFdpbjY0OyB4NjQpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS84My4wLjQxMDMuMTE2IFNhZmFyaS81MzcuMzY8L0F0dHJpYnV0ZVZhbHVlPjwvQXR0cmlidXRlPjxBdHRyaWJ1dGUgTmFtZT0iRGVzdGluYXRpb25TU04iIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiIEZyaWVuZGx5TmFtZT0iS2Vubml0YWxhTcOzdHRha2FuZGEiPjxBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHNkOnN0cmluZyI+NDcwODE4MDQyMDwvQXR0cmlidXRlVmFsdWU+PC9BdHRyaWJ1dGU+PEF0dHJpYnV0ZSBOYW1lPSJNb2JpbGUiIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiIEZyaWVuZGx5TmFtZT0iRmFyc8OtbWFuw7ptZXIiPjxBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHNkOnN0cmluZyI+KzM1NC02MTczODA3PC9BdHRyaWJ1dGVWYWx1ZT48L0F0dHJpYnV0ZT48L0F0dHJpYnV0ZVN0YXRlbWVudD48L0Fzc2VydGlvbj48L1Jlc3BvbnNlPg==";

            IslandLogin il       = new IslandLogin(token);
            bool        verified = il.Verify();

            Console.WriteLine($"Verified: {verified}");
            Console.WriteLine("=============");
            Console.WriteLine($"Audience: {il.Island.Audience}");
            Console.WriteLine($"Authentication: {il.Island.Authentication}");
            Console.WriteLine($"AuthId: {il.Island.AuthId}");
            Console.WriteLine($"Destination: {il.Island.Destination}");
            Console.WriteLine($"Id: {il.Island.Id}");
            Console.WriteLine($"IPAddress: {il.Island.IPAddress}");
            Console.WriteLine($"Name: {il.Island.Name}");
            Console.WriteLine($"NotBefore: {il.Island.NotBefore}");
            Console.WriteLine($"NotOnOrAfter: {il.Island.NotOnOrAfter}");
            Console.WriteLine($"ReceiverId: {il.Island.ReceiverId}");
            Console.WriteLine($"UserAgent: {il.Island.UserAgent}");
            Console.WriteLine($"UserId: {il.Island.UserId}");

            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public void IslandVerifyTest()
        {
            IslandLogin il = new IslandLogin(Token);

            // Verification is supposed to fail, the timestamps are expired.
            Assert.False(il.Verify());
        }
Ejemplo n.º 3
0
        public void IslandVerifyTestWithManualTimestamps()
        {
            IslandLogin il = new IslandLogin(Token);

            // Manually set timestamps so they pass verification.
            il.Island.NotBefore    = DateTime.Now.AddMinutes(-5);
            il.Island.NotOnOrAfter = DateTime.Now.AddMinutes(5);

            Assert.True(il.Verify());
        }