Example #1
0
        private string GetSecurityToken()
        {
            List <Claim> claims = new List <Claim>();

            claims.Add(new Claim($"http://{hostname.ToLowerInvariant()}/role", "diagnostics"));
            string issuer   = $"http://{hostname.ToLowerInvariant()}/";
            string audience = issuer;

            SkunkLab.Security.Tokens.JsonWebToken jwt = new SkunkLab.Security.Tokens.JsonWebToken(symmetricKey, claims, 65000, issuer, audience);
            return(jwt.ToString());
        }
Example #2
0
 static string CreateJwt(string audience, string issuer, List <Claim> claims, string symmetricKey, double lifetimeMinutes)
 {
     SkunkLab.Security.Tokens.JsonWebToken jwt = new SkunkLab.Security.Tokens.JsonWebToken(new Uri(audience), symmetricKey, issuer, claims, lifetimeMinutes);
     return(jwt.ToString());
 }