-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Description
Hey there!
We recently had a use case where we wanted to use HttpOnly Cookies to transfer the Keycloak JWT instead of the Authorization header. The modifications to achieve that were rather minimal:
We basically only had to add ?? $this->request->cookies->get($inputKey) to https://github.com/robsontenorio/laravel-keycloak-guard/blob/master/src/KeycloakGuard.php#L61C56-L61C63.
/**
* Get the token for the current request.
*
* @return string
*/
public function getTokenForRequest()
{
$inputKey = $this->config['input_key'] ?? "";
return $this->request->bearerToken() ?? $this->request->input($inputKey) ?? $this->request->cookies->get($inputKey);
}Maybe this is a use case that is also interesting for others?
Best,
Lauritz
Metadata
Metadata
Assignees
Labels
No labels