pub fn validate_aud(&self, validation: Validation<String>) -> Result<(), ValidationError> {
        match validation {
            Validation::Ignored => Ok(()),
            Validation::Validate(expected_aud) => match self.audience {
                Some(SingleOrMultiple::Single(ref audience)) if audience != &expected_aud => Err(
                    ValidationError::InvalidAudience(self.audience.clone().unwrap()),
                ),
                Some(SingleOrMultiple::Multiple(ref audiences))
                    if !audiences.contains(&expected_aud) =>
                {
                    Err(ValidationError::InvalidAudience(
                        self.audience.clone().unwrap(),
                    ))
                }
                _ => Ok(()),
            },
        }
    }
/// Validates that if the token has an `aud` claim, it contains an entry which matches the expected audience
Validates that if the token has an `aud` claim, it contains an entry which matches the expected audience
Validates that if the token has an ` aud ` claim it contains an entry which matches the expected audience
pub fn validate_aud(&self, validation: Validation<String>) -> Result<(), ValidationError> {
        match validation {
            Validation::Ignored => Ok(()),
            Validation::Validate(expected_aud) => match self.audience {
                Some(SingleOrMultiple::Single(ref audience)) if audience != &expected_aud => Err(
                    ValidationError::InvalidAudience(self.audience.clone().unwrap()),
                ),
                Some(SingleOrMultiple::Multiple(ref audiences))
                    if !audiences.contains(&expected_aud) =>
                {
                    Err(ValidationError::InvalidAudience(
                        self.audience.clone().unwrap(),
                    ))
                }
                _ => Ok(()),
            },
        }
    }
pub fn validate_aud ( & self , validation : Validation < String > ) -> Result < ( ) , ValidationError > { match validation { Validation :: Ignored => Ok ( ( ) ) , Validation :: Validate ( expected_aud ) => match self . audience { Some ( SingleOrMultiple :: Single ( ref audience ) ) if audience != & expected_aud => Err ( ValidationError :: InvalidAudience ( self . audience . clone ( ) . unwrap ( ) ) , ) , Some ( SingleOrMultiple :: Multiple ( ref audiences ) ) if ! audiences . contains ( & expected_aud ) => { Err ( ValidationError :: InvalidAudience ( self . audience . clone ( ) . unwrap ( ) , ) ) } _ => Ok ( ( ) ) , } , } }
Validates that if the token has an `aud` claim, it contains an entry which matches the expected audience
Validates that if the token has an ` aud ` claim it contains an entry which matches the expected audience
&self
validation
Validation<String>
&self
validation
Validation<String>