public bool TryValidate(JwtHeaderDocument header, JwtPayloadDocument payload, [NotNullWhen(false)] out TokenValidationError?error) { if (payload is null) { error = TokenValidationError.MalformedToken(); return(false); } if (payload.ContainsClaim(OAuth2Claims.AuthTime.EncodedUtf8Bytes)) { error = null; return(true); } error = TokenValidationError.MissingClaim(OAuth2Claims.AuthTime.ToString()); return(false); }
public bool TryValidate(JwtHeaderDocument header, JwtPayloadDocument payload, [NotNullWhen(false)] out TokenValidationError?error) { if (payload is null) { error = TokenValidationError.MalformedToken(); return(false); } if (payload.ContainsClaim(_claim)) { error = null; return(true); } error = TokenValidationError.MissingClaim(_claim); return(false); }
public bool TryValidate(JwtHeaderDocument header, JwtPayloadDocument payload, [NotNullWhen(false)] out TokenValidationError?error) { if (payload is null) { error = TokenValidationError.MalformedToken(); return(false); } if (payload.ContainsClaim(_claim)) { #if NET5_0_OR_GREATER Unsafe.SkipInit(out error); #else error = default; #endif return(true); } error = TokenValidationError.MissingClaim(_claim); return(false); }