validate

fun validate(body: suspend ApplicationCall.(String) -> Principal?)

Sets a validation function that will check given API key retrieved from headerName instance and return Principal, or null if credential does not correspond to an authenticated principal.

Sources