[−][src]Trait roa::jwt::JwtVerifier
This is supported on
feature="jwt"
only.A context extension.
This extension must be used in downstream of middleware guard
or guard_by
,
otherwise you cannot get expected claims.
Example
use roa::{Context, Result}; use roa::jwt::JwtVerifier; use serde_json::Value; async fn get(ctx: &mut Context) -> Result { let claims: Value = ctx.claims()?; Ok(()) }
Required methods
fn claims<C>(&self) -> Result<C> where
C: 'static + DeserializeOwned,
C: 'static + DeserializeOwned,
This is supported on
feature="jwt"
only.Deserialize claims from token.
fn verify<C>(&mut self, validation: &Validation) -> Result<C> where
C: 'static + DeserializeOwned,
C: 'static + DeserializeOwned,
This is supported on
feature="jwt"
only.Verify token and deserialize claims with a validation.
Use this method if this validation is different from that one of JwtGuard
.
Implementors
impl<S> JwtVerifier<S> for Context<S>
[src]
fn claims<C>(&self) -> Result<C> where
C: 'static + DeserializeOwned,
[src]
C: 'static + DeserializeOwned,
fn verify<C>(&mut self, validation: &Validation) -> Result<C> where
C: 'static + DeserializeOwned,
[src]
C: 'static + DeserializeOwned,