Skip to main content

parse_service_validate

Function parse_service_validate 

Source
fn parse_service_validate(body: &[u8]) -> Option<String>
Expand description

Extracts the authenticated username from a CAS /serviceValidate response.

Handles both the default CAS 2.0 XML (<cas:authenticationSuccess> / <cas:user>, with or without the cas: prefix) and the CAS 3.0 JSON (serviceResponse.authenticationSuccess.user) formats. Returns None for an authentication-failure response or anything unparseable.