pub struct JwksVerifier { /* private fields */ }Expand description
Token verifier with JWKS support for key rotation
Implementations§
Source§impl JwksVerifier
impl JwksVerifier
Sourcepub fn new(
jwks: Jwks,
issuer: impl Into<String>,
audience: impl Into<String>,
) -> Self
pub fn new( jwks: Jwks, issuer: impl Into<String>, audience: impl Into<String>, ) -> Self
Create a new JWKS verifier
Sourcepub fn with_origin_validation(self) -> Self
pub fn with_origin_validation(self) -> Self
Require origin validation
Sourcepub fn verify(
&self,
token: &str,
expected_origin: Option<&str>,
expected_client_ip: Option<&str>,
) -> Result<AuthContext, VerifyError>
pub fn verify( &self, token: &str, expected_origin: Option<&str>, expected_client_ip: Option<&str>, ) -> Result<AuthContext, VerifyError>
Verify a token using the appropriate key from JWKS
Trait Implementations§
Source§impl Clone for JwksVerifier
impl Clone for JwksVerifier
Source§fn clone(&self) -> JwksVerifier
fn clone(&self) -> JwksVerifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for JwksVerifier
impl RefUnwindSafe for JwksVerifier
impl Send for JwksVerifier
impl Sync for JwksVerifier
impl Unpin for JwksVerifier
impl UnsafeUnpin for JwksVerifier
impl UnwindSafe for JwksVerifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more