goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
7.86k stars 604 forks source link

Multiple Client IDs per OIDC Issuer? #7251

Open mrdrogdrog opened 8 months ago

mrdrogdrog commented 8 months ago

Describe your question Hello :wave: ,

is it possible to use different OIDC client ids that work on the same issuer? I try to setup a software which consists of multiple different parts:

In my first run i've setup the server (and therefore also the web client). I've created an OIDC provider and an application in authentik. Everything works fine so far. If I use the desktop client or the app then it doesn't work anymore. Both of these force specific client ids and secrets. Therefore I've created more OIDC providers and applications with the requested client id and secret because apparently there is no way to assign multiple provders to one application or multiple client ids to one issuer. I can get through the login flow with these but then the server says that the provided JWTs are invalid because the issuer is invalid.

Have I missed anything or am I right and this kind of setup is just not possible with Authentik?

Relevant infos

Version and Deployment (please complete the following information):

WoodyWoodsta commented 6 months ago

I'll add that when you set up Google as an OIDC provider, they require you to generate a client id and secret pair per platform. We have, at the moment, an iOS and Android app, which means we need to configure at least two providers.

Not sure if this question is the same as above.

bbl232 commented 3 months ago

I would also like to see this added. Owncloud requires this for the same reason. One client ID for the web app, and the android, iOS and desktop sync clients all have their own client id/secret baked in.

NeZios commented 3 months ago

Same issue here, I followed this tutorial to add OIDC on my OCIS instance with Authentik : https://helgeklein.com/blog/owncloud-infinite-scale-with-openid-connect-authentication-for-home-networks/

Thanks for the help

codesalatdev commented 1 month ago

Since OwnCloud follows OIDC spec, one cannot use a .well-known provided at https://auth.example.com/application/o/owncloud/.well-known/openid-configuration which contains the issuer https://auth.example.com (when trying to use a single issuer for multiple providers). Likewise, we cannot use https://auth.example.com as an issuer, because as per OIDC spec issuers with discovery functionality MUST expose an openid-configuration at [ISSUER_URL]/.well-known/openid-configuration, which Authentik does not.

I was also unable to use a single issuer, like https://auth.example.com/application/o/owncloud for multiple providers.

I MUST be doing something wrong here, because I cannot imagine hitting a hard limit with Authentik while trying to migrate the first of many applications away from KeyCloak.

BeryJu commented 1 month ago

This is not currently possible, even with policies this cannot be done as the client_id check/lookup happens before any policy is run. The fact that when setting the issuer mode to be global, the discovery endpoints are not available is also on purpose, as authentik wouldn't know which provider to associate the request with (However this might be possible soon with https://github.com/goauthentik/authentik/issues/5440)