keycloak / keycloak/keycloak-nodejs-connect

Extract bearer token from cookies

Open
#349 0 comments 9 reactions 0 assignees View on GitHub
kind/enhancement status/triage
Dominant language
JavaScript
Stars
740
Forks
442
PR merge metrics
No merged PRs in 30d

Description

### Description

When there is no bearer token present in the authentication header. The adapter should look through cookies to see if a bearer token is present there. If a bearer token is present, the adapter should use that one, instead of throwing a `No bearer in header` error.

### Discussion

_No response_

### Motivation

When the bearer token is stored in a cookie, the adapter can't find the bearer token. Making it throw a 'No bearer in header' error.
I would like to use a cookie to store my bearer token instead of putting it in a header. While being able to retrieve permissions from keycloak.

### Details

I'm willing to make a PR to address this.

Contributor guide

Open the contributing guide

Research direction

No file or test is named. Start by locating the adapter path that raises the `No bearer in header` error and inspect how the request's authentication header and cookies are exposed; done means a bearer token in cookies is used when the header has none, without changing the existing header behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.