private void Initialise(JsonWebToken jsonWebToken) { this.IsAuthenticated = true; this.AuthenticationType = jsonWebToken.Claims.Audience; this.Name = jsonWebToken.Claims.UserId; this.UserId = jsonWebToken.Claims.UserId; this.Credentials = jsonWebToken.Claims.Credentials; }
private static JsonWebToken CreateJsonWebToken(string accessToken) { JsonWebToken jsonWebToken = null; try { //TODO.. JsonWebToken.Create jsonWebToken = new JsonWebToken(accessToken, Configuration.GetApplicationMasterKey()); if (jsonWebToken.IsExpired) jsonWebToken = null; } catch { //TODO:pokemon need a logger and good exceptions } return jsonWebToken; }
public ZumoIdentity(JsonWebToken jsonWebToken) { if (jsonWebToken == null) throw new ArgumentNullException("jsonWebToken"); Initialise(jsonWebToken); }