| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR adds mandatory support for the OAuth 2.0 Client Credentials Grant to the Solid-OIDC specification to enable non-interactive authentication for scripts, automated agents, and server-to-server communication. Both major implementations (Community Solid Server and Enterprise Solid Server) already support this feature.
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| When using the Client Credentials Grant, the Client authenticates with the OP using a | ||
| `client_id` and `client_secret` pair previously obtained through client registration | ||
| (either static or dynamic). The Client sends a token request to the OP's token endpoint | ||
| with `grant_type=client_credentials` and the `webid` scope. |
There was a problem hiding this comment.
There's a potential contradiction with the statement at lines 121-122 which says "client registration, whether dynamic, or static, is entirely optional." The Client Credentials Grant inherently requires client registration to obtain the client_id and client_secret pair. Consider either: (1) clarifying at lines 121-122 that client registration is optional for some flows but required for Client Credentials Grant, or (2) adding a note in the Client Credentials section that explicitly acknowledges this requirement represents an exception to the general optional nature of client registration mentioned in the Core Concepts section.
| When using the Client Credentials Grant, the Client authenticates with the OP using a | |
| `client_id` and `client_secret` pair previously obtained through client registration | |
| (either static or dynamic). The Client sends a token request to the OP's token endpoint | |
| with `grant_type=client_credentials` and the `webid` scope. | |
| When using the Client Credentials Grant, the Client MUST be registered with the OP and | |
| authenticate using a `client_id` and `client_secret` pair previously obtained through | |
| client registration (either static or dynamic). This requirement is an exception to the | |
| general statement in the Core Concepts section that client registration is optional. The | |
| Client sends a token request to the OP's token endpoint with `grant_type=client_credentials` | |
| and the `webid` scope. |
Sorry, something went wrong.
There was a problem hiding this comment.
@acoburn @joachimvh can you confirm this is accurate with your implementations?
Sorry, something went wrong.
| Additionally, the OP MUST include `client_credentials` in its `grant_types_supported` | ||
| metadata property to indicate support for non-interactive authentication | ||
| via the Client Credentials Grant (see [[#client-credentials]]). |
There was a problem hiding this comment.
This requirement duplicates the one already stated in the Client Credentials Grant section (lines 310-311). The same requirement appears twice: once in the Client Credentials Grant section and once here in the Conformance Discovery section. Consider removing the duplication by keeping only one of these statements, or if both are intentional, clarify why the requirement is repeated. Typically, the discovery/conformance section would be the natural place for such metadata requirements, making lines 310-311 potentially redundant.
| Additionally, the OP MUST include `client_credentials` in its `grant_types_supported` | |
| metadata property to indicate support for non-interactive authentication | |
| via the Client Credentials Grant (see [[#client-credentials]]). | |
| Additionally, an OP that supports non-interactive authentication | |
| via the Client Credentials Grant (see [[#client-credentials]]) indicates this support by including | |
| `client_credentials` in its `grant_types_supported` metadata property. |
Sorry, something went wrong.
There was a problem hiding this comment.
Only to implement this change if we go with MAY wording over MUST.
Sorry, something went wrong.
|
@laurensdeb could you please also review it? I think we should add a note about limitation around Client IDs that are URLs, I have PR to CSS that allows it Still only one user can use client with given Client ID URL. Since it is often used for scripts that aren't multi tenant it migth be fine. In case of multi tenant clients, I also made an early draft that uses another flow/grant @acoburn does ESS support client credentials with Client ID URL? |
Sorry, something went wrong.
| communication. | ||
|
|
||
| When using the Client Credentials Grant, the Client authenticates with the OP using a | ||
| `client_id` and `client_secret` pair previously obtained through client registration |
Sorry, something went wrong.
There was a problem hiding this comment.
For example this draft PR to CSS uses RFC7523
Sorry, something went wrong.
| (either static or dynamic). The Client sends a token request to the OP's token endpoint | ||
| with `grant_type=client_credentials` and the `webid` scope. | ||
|
|
||
| The OP MUST validate the `client_id` and `client_secret`, and if valid, MUST return |
There was a problem hiding this comment.
See comment above, I would not normatively require the use of a client_secret.
Sorry, something went wrong.
| with the token request. | ||
|
|
||
| The OP MUST advertise `client_credentials` in its `grant_types_supported` | ||
| metadata property in its OpenID Connect Discovery 1.0 [[!OIDC-DISCOVERY]] document. |
There was a problem hiding this comment.
Note that the grant_types_supported metadata field of OpenID connect is optional. I don't think it makes sense to introduce a MUST therefore, in particular given that this is an OAuth grant type.
Sorry, something went wrong.
There was a problem hiding this comment.
I generally don't think it makes a lot of sense to introduce client_credentials grant as part of the Solid-OIDC specification. The general remarks I made previously on supporting additional grant types are still quite relevant here.
The main issue I see is that OIDC builds on top of the OAuth2 protocol, therefore it would make more sense to do a thorough refactoring here and extract aspects specific to OAuth in a Solid-OAuth specification, and have the Solid-OIDC specification extend that for the authorization_code grant.
The introduction of a Solid-OAuth specification would have the benefit of being able to e.g. drop the requirement of DPoP for client_credentials grant, as it makes very little sense for a confidential client (which would typically be the case for a client_credentials based flow).
Sorry, something went wrong.
@laurensdeb could you please clarify? Even with confidential clients, when aud is not restricted to a specific AS, DPoP is needed so the AS which receives the id token (authentication credential) can not reuse that token/credential elsewhere. |
Sorry, something went wrong.
There was a problem hiding this comment.
Rather than focus on particular line changes in this PR, there are some high level issues that would be good to clarify.
Sorry, something went wrong.
If there were some Solid-OAuth specification, I would highly recommend requiring an audience constraint via the aud claim. With that requirement in place, DPoP becomes largely unnecessary as a requirement. (Certain deployment scenarios may still wish to require DPoP for other reasons, but the motivating use case for DPoP was the concern about having a malicious Solid server replay a token at some other Solid server, and this would be addressed with audience constraints). |
Sorry, something went wrong.
|
In this sketch https://elf-pavlik.github.io/lws-auth/view/oidc/?dynamic=sequence |
Sorry, something went wrong.
|
@elf-pavlik As Aaron mentioned, in a more general Solid-OAuth scenario an audience constrained access token would make more sense than a sender constrained access token using DPoP. I agree that there still is a risk of a malicious RS or AS intercepting a token, so a mechanism still needs to be in place to constrain the token to a target. |
Sorry, something went wrong.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Yes, the goal is to enable support for scripts and bots. More directly, it reflects how scripts and bots can currently authenticate into two of the predominant implementations of Solid (ESS and CSS). I would like to leave discussions of what could be done to the Linked Web Storage group -- where we are considering such alternative methods for script/bot authentication.
Yes - happy to split this out.
👍
As responded to in (1) I would like to leave discussions of what could be done to the Linked Web Storage group -- where we are considering such alternative methods for script/bot authentication. |
Sorry, something went wrong.
It is important to note that scripts and bots can currently use Solid-OIDC without any changes via the refresh token flow. The typical patterns here all involve some browser-based interaction and result in the script being given access to the resulting refresh token. |
Sorry, something went wrong.
There was a problem hiding this comment.
If the goal is to document how Inrupt's ESS implements client credentials, I would highly recommend not conflating OAuth-based flows with OpenID connect-based flows at the protocol level. Instead, a separate, Solid-OAuth CG document would be quite suitable.
Sorry, something went wrong.
|
@acoburn does it still result in client obtaining ID Token and the Client - AS + RS interaction stays the same? |
Sorry, something went wrong.
By "it", I assume that you mean the refresh token flow. In that case, yes. A client begins by interacting with the authorization_endpoint, requesting the following scopes: openid webid offline_access. Everything else follows normal OpenID Connect flows, resulting in an ID token and a refresh token that can later be exchanged for another ID token. All the other interactions with AS/RS stay the same. The important discovery mechanism for this is the scopes_supported field in the OpenID Connect metadata: by including offline_access in that array, an OpenID Provider signals that it supports the refresh token flow. |
Sorry, something went wrong.
|
I'm sorry I meant ESS client credentials flow |
Sorry, something went wrong.
|
For the client_credentials flow in ESS, a user is able to create credentials via a web UI. This binds these opaque values to a particular WebID. The values can be used to authenticate the client at the token_endpoint with grant_type=client_credentials. A successful response will include an ID token that can be used normally within Solid. |
Sorry, something went wrong.
|
Thanks!
Since client_credentials grant type results in DPoP bound ID Token, can we really cleanly separate OAuth-based and OIDC-based? If @jeswr extract this PR into a seprarate spec, it looks like it would still need Solid-OIDC as a normative reference 🤔 |
Sorry, something went wrong.
# Conflicts: # index.bs
| Authorization Servers MUST support the OAuth 2.0 Client Credentials Grant [[!RFC6749]] (Section 4.4) to enable | ||
| non-interactive authentication for scripts, automated agents, and server-to-server communication. | ||
|
|
||
| NOTE: Scripts and bots can also use Solid-OIDC without Client Credentials via the refresh token flow, when supported by |
There was a problem hiding this comment.
Is there a reference we can provide for the refresh token flow?
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
Co-authored-by: Jesse Wright <63333554+jeswr@users.noreply.github.com>
|
I have extracted the changes here to a new section that could become a separate specification. @acoburn @elf-pavlik @uvdsl could you please check whether this reflects your discussion with @jeswr. |
Sorry, something went wrong.
| When using the Client Credentials Grant, the Client authenticates with the OP using a `client_id` and `client_secret` | ||
| pair previously obtained through client registration (either static or dynamic). The Client sends a token request to |
There was a problem hiding this comment.
I am ok with adding a requirement for the client_credentials grant type, and it is important to note the this grant flow requires authentication. However, client_id/client_secret is only one type of authentication that could be used in this flow, and it is (arguably) not the most secure. I would be much happier if the requirements here are limited to:
RFC6749 section 4.4.2 and section 3.2.1 already include requirements for authentication, so there is no need to normatively reiterate that here. It is fine to use client_id/client_secret pairs as non-normative examples, but I would not require that as the lone authentication mechanism. RFC7523 presents another way to handle authentication using JWTs, and other mechanisms will emerge over time.
Sorry, something went wrong.
There was a problem hiding this comment.
69ea20f makes example non-normative and notes RFC7523.
Sorry, something went wrong.
| During Token Instantiation [[#tokens]], if the [Client Credentials | ||
| Grant](https://www.rfc-editor.org/rfc/rfc6749#section-4.4) is used, the OP MUST validate the `client_id` and | ||
| `client_secret`. If valid, the OP MUST return a DPoP-bound OIDC ID Token. |
There was a problem hiding this comment.
As already described, this section should emphasize the requirement for authentication, but not the particular mechanism for authentication.
For example, this would be a more suitable line:
During Token Instantiation, if the Client Credentials Grant is used, the OP MUST validate the client's authentication credentials.
(Note, though, that this requirement is already present via RFC 6749 and restating it is, strictly speaking, not necessary)
Sorry, something went wrong.
There was a problem hiding this comment.
50e297d makes the authentication requirement generic.
Sorry, something went wrong.
|
I think we still miss clarification on how the OP should set those two claims
If dynamic client registration is used I don't see how server would know the WebID of the user to set the webid claim. Even if one would want to use client_id as both webid and azp, WebID has to be URL and I haven't seen dynreg using URLs for client ids. Is there a single implementation that we know of using client credentials with dynreg? In case of manual registration, which is implementation specific, OP should (must?) bind client_id to the user who registered it and use that user's WebID in ID token. Would it make sense to specify that clients using client credentials MUST be single tenant? |
Sorry, something went wrong.
176406f clarifies the requirement to bind webid to client_id. |
Sorry, something went wrong.
|
@acoburn @elf-pavlik @uvdsl could you please check whether most recent changes address your comments.
|
Sorry, something went wrong.
Co-authored-by: elf Pavlik <elf-pavlik@hackers4peace.net>
There was a problem hiding this comment.
Let's give @uvdsl a chance to review this PR, we could merge it during CG meeting on Wednesday.
Sorry, something went wrong.
There was a problem hiding this comment.
I suggested a minor addition in the example to clarify that the client credentials pair is bound to a user.
I note that we are doubling the section on token instantiation, which we as editors should clean up one way or another at some point - but this is an editorial problem, not a problem of this PR in particular.
Sorry, something went wrong.
Co-authored-by: Christoph Braun <christoph.braun@protonmail.com>
| Back | FazBrowse Home | New Git URL |
This PR makes client credentials a MUST as part of the solid-oidc specification. The CSS and ESS both currently implement client credentials. There respective documentation can be found as follows:
Questions:
cc @acoburn @joachimvh @elf-pavlik @thhck @uvdsl @dmitrizagidulin