Skip to main content

ClaimsPlugin

Trait ClaimsPlugin 

Source
pub trait ClaimsPlugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn normalize(&self, raw: &Value) -> Result<Claims, ClaimsError>;
}
Expand description

Plugin that knows how to normalize provider-specific claims into standard Claims format

Required Methods§

Source

fn name(&self) -> &str

Returns the name of this plugin (for debugging/logging)

Source

fn normalize(&self, raw: &Value) -> Result<Claims, ClaimsError>

Normalize provider-specific claims into our standard format

Extract:

  • sub (must be UUID)
  • issuer
  • audiences
  • expiration/not-before times
  • tenants (must be UUIDs)
  • roles
  • any extra provider-specific fields
§Errors

Returns ClaimsError if required claims are missing or have invalid format.

Implementors§