aam_extract_jwt_filter
Purpose
Return the JWT string when service.jwt.bearer includes a custom carrier. AAM calls this filter only for carrier names it does not handle itself.
Callback
- Type: Filter.
- Arguments:
$token(nullby default),$method(carrier name). - Return: the filtered first argument.
Example
add_filter('aam_extract_jwt_filter', function ($token, $method) {
if ($method === 'custom_header') {
return $_SERVER['HTTP_X_API_TOKEN'] ?? null;
}
return $token;
}, 10, 2);
With service.jwt.bearer = "custom_header", AAM reads the token from X-Api-Token. Preserve the incoming value for other carriers.
See the complete hook list.