Skip to content

auth: add new jwt authentication support#66

Open
mvo5 wants to merge 1 commit into
systemd:mainfrom
mvo5:jwt-auth
Open

auth: add new jwt authentication support#66
mvo5 wants to merge 1 commit into
systemd:mainfrom
mvo5:jwt-auth

Conversation

@mvo5

@mvo5 mvo5 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

This commit adds basic support for authentication via a
Json Web Token (JWT). This works by adding a new JwtAuthenticator
to the bridge. The keys (jwks) can come from a local file or from
a URL (and can be auto-discovered).

That takes the following parameters (via cli or systemd credentials):

--issuer=URL                accepted 'iss' claim
--audience=ID               accepted 'aud' claim (default: hostname)
--issuer-jwks=PATH          (optional) issuer JWKS file (RS256/ES256 public keys)
--require-claim=NAME=VALUE  require claim NAME to match VALUE (repeatable)

There must be at least one required claim (currently) to ensure
the bridge is not too open. In many setups (e.g. GH) the "aud" is
caller-controlled so it cannot be a security boundary. Ensure that
the issuer claims cannot be forged (e.g. repository= on github
OIDC).

Note that this is bearer token only for now. Doing PoP (RFC 9421/DPoP)
is planned but this commit is already quite long.

@mvo5
mvo5 force-pushed the jwt-auth branch 7 times, most recently from 96dfb61 to dbd9b87 Compare July 6, 2026 09:08

@keszybz keszybz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started looking through this, but a new version was pushed. Those comments might be outdated.

But I see that it still needs another rebase.

Comment thread src/bin/varlink-httpd/auth_jwt.rs Outdated
Comment thread src/bin/varlink-httpd/auth_jwt.rs Outdated
Comment thread src/bin/varlink-httpd/auth_jwt.rs Outdated
Comment thread src/bin/varlink-httpd/auth_jwt.rs Outdated
Comment thread src/bin/varlink-httpd/auth_jwt.rs Outdated
Comment thread src/bin/varlink-httpd/auth_jwt.rs Outdated
Comment thread src/bin/varlink-httpd/auth_jwt.rs Outdated
@mvo5
mvo5 force-pushed the jwt-auth branch 2 times, most recently from 56ed889 to 5b0d787 Compare July 14, 2026 20:05
This commit adds basic support for authentication via a
Json Web Token (JWT). This works by adding a new JwtAuthenticator
to the bridge. The keys (jwks) can come from a local file or from
a URL (and can be auto-discovered).

That takes the following parameters (via cli or systemd credentials):
```
--issuer=URL                accepted 'iss' claim
--audience=ID               accepted 'aud' claim (default: hostname)
--issuer-jwks=PATH          (optional) issuer JWKS file (RS256/ES256 public keys)
--require-claim=NAME=VALUE  require claim NAME to match VALUE (repeatable)
```
There must be at least one required claim (currently) to ensure
the bridge is not too open. In many setups (e.g. GH) the "aud" is
caller-controlled so it cannot be a security boundary. Ensure that
the issuer claims cannot be forged (e.g. repository= on github
OIDC).

Note that this is bearer token only for now. Doing PoP (RFC 9421/DPoP)
is planned but this commit is already quite long.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants