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§
Sourcefn normalize(&self, raw: &Value) -> Result<Claims, ClaimsError>
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.