Skip to content

Native Clients JWS signing key is not known to kanidm #1713

@ByteSquire

Description

@ByteSquire

Describe the bug

When logging in to my kanidm oidc, the browser window says success but the app says invalid credentials.
In the kanidm logs I just see this error message:
[error]: JWS is signed by a key that is not present in this KeyObject
[error]: Unable to verify access token | err: KP0022KeyObjectJwsNotAssociated

And in the opencloud logs I see:
ERR failed to authenticate the request error="failed to verify access token: token is unverifiable: error while executing keyfunc: the given key ID was not found in the JWKS" authenticator=oidc client.address=10.89.0.9 line=github.com/opencloud-eu/opencloud/services/proxy/pkg/middleware/oidc_auth.go:198 network.peer.address= network.peer.port= path=/remote.php/dav/files// service=proxy user_agent="Mozilla/5.0 (Android) OpenCloud-android/1.0.0"

ERR failed to authenticate the request error="failed to verify access token: token is unverifiable: error while executing keyfunc: the given key ID was not found in the JWKS" authenticator=oidc client.address=10.89.0.9 line=github.com/opencloud-eu/opencloud/services/proxy/pkg/middleware/oidc_auth.go:198 network.peer.address= network.peer.port= path=/ocs/v2.php/cloud/user service=proxy user_agent="Mozilla/5.0 (Linux) mirall/3.0.0.1741 (OpenCloud Beta, fedora-6.16.11-200.fc42.x86_64 ClientArchitecture: x86_64 OsArchitecture: x86_64)"

Steps to reproduce

  1. deploy opencloud with external idp
  2. add client to kanidm, and create a custom claim map with aud=OpenCloudDesktop/-Android...
  3. try to login using one of the native apps (I have tried with linux desktop and android app)

Expected behavior

The client logs in successfully

Actual behavior

The browser window for the oidc login says success but the app says Invalid credentials and kanidm logs invalid signing key

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.
I have provided the url for the web client as OIDC issuer, maybe that is an issue too? Not sure if that is used by native clients

Details

OC_OIDC_ISSUER=https://idm.***.dedyn.io/oauth2/openid/opencloud_web
IDP_DOMAIN=idm.***.dedyn.io

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions