Skip to main content

www_authenticate_value

Function www_authenticate_value 

Source
pub fn www_authenticate_value(resource_url: &str, scope: Option<&str>) -> String
Expand description

Build the value of an WWW-Authenticate: Bearer ... response header pointing browsers/agents at the protected-resource metadata document.

When scope is Some and non-empty, a scope="..." parameter (RFC 6750 Section 3) is appended so clients get immediate guidance on which scopes to request during authorization, per the MCP spec’s WWW-Authenticate guidance. scope is expected to be a space-joined scope list (e.g. "syslog:read syslog:admin").