# Solid-OIDC Client IDs

[Solid-OIDC Client Identifiers (Client IDs)](https://solid.github.io/solid-oidc/#clientids) are URIs that dereference to a JSON-LD document, namely the [Client ID document](https://solid.github.io/solid-oidc/#clientids-document).

The Client ID document is a [JSON-LD document](https://solid.github.io/solid-oidc/#clientids-document) with:

* A **`@context`** value of **`https://www.w3.org/ns/solid/oidc-context.jsonld`**.
* Fields conformant to an [OIDC client registration](https://openid.net/specs/openid-connect-registration-1_0.html#ClientMetadata).

For example, the following sample JSON-LD document may be found by dereferencing the Client ID **`https://my-app.example.com/myappid.jsonld`**:

```java
{
  "@context": "https://www.w3.org/ns/solid/oidc-context.jsonld",
  "client_id": "https://my-app.example.com/myappid.jsonld",
  "redirect_uris": ["https://my-app.example.com/callbackAfterLogin"],
  "client_name": "My Sample App",
  "client_uri": "https://my-app.example.com/",
  "logo_uri": "https://my-app.example.com/logo.png",
  "tos_uri": "https://my-app.example.com/terms.html",
  "policy_uri": "https://my-app.example.com/policy.html",
  "contacts": ["someone@example.com"],
  "scope" : "openid offline_access webid",
  "grant_types" : ["refresh_token","authorization_code"],
  "post_logout_redirect_uris": [
    "https://my-app.example.com/"
  ]
}
```

<table><thead><tr><th width="153.74609375">Field</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>@context</code></strong></td><td>The context for the JSON-LD document. The expected <strong><code>@context</code></strong> value is <strong><code>https://www.w3.org/ns/solid/oidc-context.jsonld</code></strong>.</td></tr><tr><td><strong><code>client_id</code></strong></td><td>A string containing the application's Client Identifier.</td></tr><tr><td><strong><code>redirect_uris</code></strong></td><td><p>An array containing URIs where the Solid Identity Provider may redirect the user to complete the login process.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Tip</strong><br>To test with a locally running application during development, you can specify the localhost url (i.e., <strong><code>https://localhost:&#x3C;port></code></strong>) in both:<br>• the <strong><code>redirect_uris</code></strong> in the Client Identifier, and<br>• the <strong><code>redirectUrl</code></strong> in the application's <strong><code>login()</code></strong> call.</p></div></td></tr><tr><td><strong><code>scope</code></strong></td><td><p>A string containing a space-delimited list of OAuth2.0 scopes your application is allowed to request. OAuth2.0 scopes include:</p><p>Custom values may also be specified.</p></td></tr><tr><td>Scope</td><td>Notes</td></tr><tr><td><strong><code>openid</code></strong></td><td><strong><code>openid</code></strong> is <mark style="color:red;"><strong>mandatory</strong></mark>.</td></tr><tr><td><strong><code>offline_access</code></strong></td><td>Include <strong><code>offline_access</code></strong> to be issued refresh tokens.<br><br>For the definition of <strong><code>offline_access</code></strong> scope, see <a href="https://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess">OpenID Connect: Offline Access</a>.</td></tr><tr><td><strong><code>webid</code></strong></td><td><strong><code>webid</code></strong> is <mark style="color:red;"><strong>mandatory</strong></mark></td></tr><tr><td>Scope</td><td>Notes</td></tr><tr><td><strong><code>openid</code></strong></td><td><strong><code>openid</code></strong> is <mark style="color:red;"><strong>mandatory</strong></mark>.</td></tr><tr><td><strong><code>offline_access</code></strong></td><td>Include <strong><code>offline_access</code></strong> to be issued refresh tokens.<br><br>For the definition of <strong><code>offline_access</code></strong> scope, see <a href="https://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess">OpenID Connect: Offline Access</a>.</td></tr><tr><td><strong><code>webid</code></strong></td><td><strong><code>webid</code></strong> is <mark style="color:red;"><strong>mandatory</strong></mark></td></tr><tr><td><strong><code>grant_types</code></strong></td><td><p>An array of OAuth 2.0 grant types that the client can use at the authorization server's token endpoint.</p><p>For additional values, see the grant_types definition in <a href="https://datatracker.ietf.org/doc/html/rfc7591#section-2">https://datatracker.ietf.org/doc/html/rfc7591#section-2</a>.</p></td></tr><tr><td>Grant Type</td><td>Description</td></tr><tr><td><strong><code>"authorization_code"</code></strong></td><td>The default authentication flow, based on redirections between the application and the Solid Identity Provider.</td></tr><tr><td><strong><code>"refresh_token"</code></strong></td><td>The flow where a refresh token is used to "refresh" an expired session.<br><br>Used for apps that have declared the offline_access scope (i.e., discouraged for in-browser apps).</td></tr><tr><td>Grant Type</td><td>Description</td></tr><tr><td><strong><code>"authorization_code"</code></strong></td><td>The default authentication flow, based on redirections between the application and the Solid Identity Provider.</td></tr><tr><td><strong><code>"refresh_token"</code></strong></td><td>The flow where a refresh token is used to "refresh" an expired session.<br><br>Used for apps that have declared the offline_access scope (i.e., discouraged for in-browser apps).</td></tr><tr><td><strong><code>client_name</code></strong></td><td>Optional. A string containing a user-friendly name for the application.</td></tr><tr><td><strong><code>client_uri</code></strong></td><td>Optional. A string containing the application's homepage URI.</td></tr><tr><td><strong><code>logo_uri</code></strong></td><td>Optional. A string containing the URI where the application's logo is available.</td></tr><tr><td><strong><code>tos_uri</code></strong></td><td>Optional. A string containing the URI where the application's terms of service are available.</td></tr><tr><td><strong><code>policy_uri</code></strong></td><td>Optional. A string containing the URI where the application's privacy policy is available.</td></tr><tr><td><strong><code>contacts</code></strong></td><td>Optional. An array of contact information for the application.</td></tr></tbody></table>

{% hint style="info" %}
**Tip**\
For additional fields to include in the document as well as more information on the aforementioned fields, see [RFC7591](https://datatracker.ietf.org/doc/html/rfc7591#section-2).
{% endhint %}
