Closed wapkch closed 2 months ago
@wapkch
As per https://datatracker.ietf.org/doc/html/rfc8693,there doesn't appear to be any explicit prohibition against using an access token obtained through the client_credentials grant for token exchange.
This is true but at the same time the spec does not make any reference to the client_credentials
grant type either.
Furthermore, looking at the examples in Appendix A. Additional Token Exchange Examples, you will see the subject tokens referenced contain "sub":"bdc@example.net"
and "sub":"user@example.net"
that clearly indicate a user principal.
As well, in 1.1. Delegation vs. Impersonation Semantics, it states:
One common use case for an STS (as alluded to in the previous section) is to allow a resource server A to make calls to a backend service C on behalf of the requesting user B
The word "user" is referenced in many parts in the spec, which implies there is a Resource Owner principal associated to the subject token.
I'm curious, why are you using a client_credentials
obtained access token to represent the subject token in the token_exchange
grant? If the client needs another scope, (message.read
as per your example) why wouldn't the messaging-client
be configured for the client_credentials
grant and obtain a new access token with the required scope?
@jgrandja That makes a lot of sense! Thanks for the detailed explanation. You can close this now.
Describe the bug Token exchange failed when the subject token is a client_credentials granted access token.
To Reproduce
Expected behavior As per https://datatracker.ietf.org/doc/html/rfc8693,there doesn't appear to be any explicit prohibition against using an access token obtained through the client_credentials grant for token exchange.