Skip to main content

authenticate_session

Function authenticate_session 

pub async fn authenticate_session<A>(
    auth: &A,
    handshake: &Handshake,
    init_headers: &BTreeMap<String, String>,
) -> Result<CratestackContext, CratestackError>
where A: AuthProvider,
Expand description

Runs the app’s AuthProvider over the handshake request. Init headers, when present, stand in for the handshake’s: that is how a browser, which cannot set headers on new WebTransport(url) or new WebSocket(url), presents credentials. A native client sends them on the handshake and an empty Init.