mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
🚀 Feature: Client Credentials flow support #56
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @savely-krasovsky on GitHub.
Feature description
Client Credentials flow is a very useful flow for m2m integrations. Since #566 is already merged it would be nice to support getting access token using both methods:
client_idandclient_secret.client_id+client_assertion).Pitch
Client Credentials flow can be used to programmatically bypass IAPs (Identity-Aware Proxy) such as oauth2-proxy and many others. For example it will allow monitoring products like Uptime Kuma or Gatus to monitor services behind those proxies by providing access token they received from Pocket-ID using client credential flow.
@savely-krasovsky commented on GitHub:
I think @ItalyPaleAle can provide even better examples, as he has more experience with Kubernetes, which can be configured to trust access tokens issued via the
client_credentialsflow.@stonith404 commented on GitHub:
Could you clarify the use case a bit more? I'm not really sure if I understand it correctly. From my perspective, it sounds like the idea is that one client can request an access token in order to call another client. For example, client A obtaining an access token from Pocket ID to access client B.
What's the advantage of having this over just a simple API key that is provided by the IAP, that allows client A to bypass authentication of client B?
@savely-krasovsky commented on GitHub:
@stonith404 there are many cases where a service does not provide its own tokens for access, but instead trusts access tokens issued by a trusted IdP (Identity Provider — Pocket-ID in our case). For example, this can be used for service-to-service authentication in a microservice architecture. You create an OIDC client, it contacts the IdP and exchanges the
client_id+client_secret(or aclient_assertion) for anaccess_token, and then Service A can call Service B using that token. Service B can easily verify that the token was issued for Service A by the trusted IdP. This removes the need for Service B to implement its own authentication scheme.In the case of OAuth2 Proxy, it does not have any embedded authentication mechanisms other than OAuth2 JWT access tokens passed as Bearer tokens (see docs: https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview/,
--skip-jwt-bearer-tokensflag). Notable projects such as Uptime Kuma and Gatus can use the client_credentials flow to obtain an access token and present it while polling endpoints.