public static bool TryParseBody(X509Certificate2 cert, string token, out AccessTokenBody body) { AccessToken accessToken; if (TryParse(token, out accessToken) == false) { body = null; return(false); } if (accessToken.MatchesSignature(cert) == false) { body = null; return(false); } try { body = JsonConvert.DeserializeObject <AccessTokenBody>(accessToken.Body); return(true); } catch { body = null; return(false); } }
public static bool TryParseBody(X509Certificate2 cert, string token, out AccessTokenBody body) { AccessToken accessToken; if (TryParse(token, out accessToken) == false) { body = null; return false; } if (accessToken.MatchesSignature(cert) == false) { body = null; return false; } try { body = JsonConvert.DeserializeObject<AccessTokenBody>(accessToken.Body); return true; } catch { body = null; return false; } }
public OAuthPrincipal(AccessTokenBody tokenBody) { this.tokenBody = tokenBody; }
public OAuthPrincipal(AccessTokenBody tokenBody) { this.tokenBody = tokenBody; }