Learn how to put your digital team to work with MuleSoft for Agentforce.
Contact Us 1-800-596-4880

Accessing Request Authentication Information

The Authentication injectable provides an interface to:

  • Propagate authentication data for consumption by other policies.

  • Consume authentication data already set by another policy.

To share data, Authentication implements the AuthenticationHandler trait:

pub trait AuthenticationHandler {
    fn authentication(&self) -> Option<AuthenticationData>;
    fn set_authentication(&self, authentication: Option<&AuthenticationData>);
}
Rust

The AuthenticationData struct contains the following authentication data:

pub struct AuthenticationData {
    pub principal: Option<String>,
    pub client_id: Option<String>,
    pub client_name: Option<String>,
    pub properties: Value,
}
Rust

For example, the following code reads the Authentication data and modifies it by overriding the client_id and client_name: