> For the complete documentation index, see [llms.txt](https://dev.ishare.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ishare.eu/all-roles-common-endpoints/access-token-m2m.md).

# Access token (M2M)

{% hint style="info" %}
***This page must be considered part of the iSHARE Framework***

*This page is considered normative and is therefore compliant with RFC 2119.*
{% endhint %}

## Obtains access token

> Used to obtain an OAuth access token from a Participant Registry, Authorization Registry or Service Provider. The access token must be added  under "Authorization" header attribute for secured endpoints. Refer to relevant  endpoints on proper usage.

```json
{"openapi":"3.0.0","info":{"title":"iSHARE API specifications","version":"3.0.1"},"tags":[{"name":"Participant Registry (Required)","description":"Required endpoints for the iSHARE Participant Registry API."},{"name":"Service Provider (Required)","description":"Required endpoints for the iSHARE Service Provider API."},{"name":"Authorisation Registry (Required)","description":"Required endpoints for the iSHARE Authorisation Registry API."}],"servers":[{"description":"iSHARE UAT network base domain","url":"https://isharetest.net"},{"description":"iSHARE TEST network base domain","url":"https://test.ishareworks.nl"}],"paths":{"/[v3.0]/connect/token":{"post":{"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"required":["grant_type","scope","client_id","client_assertion_type","client_assertion"],"type":"object","properties":{"grant_type":{"description":"OAuth 2.0 grant type. MUST contain “client_credentials”","type":"string"},"scope":{"description":"OAuth 2.0 scope. MUST contain iSHARE scope value. Other values allow the Service Consumer to get tokens that do not include all rights the Service Consumer has. According to RFC 6749, scopes are case-sensitive.","type":"string"},"client_id":{"description":"Used in iSHARE for all client identification for OAuth/OpenID Connect. MUST contain a valid party identifier of the Service Consumer","type":"string"},"client_assertion_type":{"description":"Used in iSHARE for all client identification for OAuth/OpenID Connect. MUST contain “urn:ietf:params:oauth:client-assertion-type:jwt-bearer”","type":"string"},"client_assertion":{"description":"Used in iSHARE for all client identification for OAuth/OpenID Connect. MUST contain JWT token conform iSHARE specifications, signed by the client.","type":"string"}}}}},"required":true},"tags":["Participant Registry (Required)","Authorisation Registry (Required)","Service Provider (Required)"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/connectTokenResponse"}}},"description":"OK"},"400":{"$ref":"#/components/responses/oauthBadRequest"},"401":{"$ref":"#/components/responses/oauthUnauthorized"},"500":{"$ref":"#/components/responses/internalServerError"}},"deprecated":false,"operationId":"request-oauth-token","summary":"Obtains access token","description":"Used to obtain an OAuth access token from a Participant Registry, Authorization Registry or Service Provider. The access token must be added  under \"Authorization\" header attribute for secured endpoints. Refer to relevant  endpoints on proper usage."}}},"components":{"schemas":{"connectTokenResponse":{"title":"ConnectTokenResponse","type":"object","properties":{"access_token":{"description":"The access token. The server MAY issue an opaque token or a signed iSHARE JWT, as in the example. The Service Consumer MUST treat the value as opaque and MUST NOT parse it.","type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"number"}}},"oauthError":{"title":"OAuth error","type":"object","required":["error"],"properties":{"error":{"type":"string","description":"OAuth 2.0 error code."},"error_description":{"type":"string","description":"Human-readable information for developers about the error."},"error_uri":{"type":"string","format":"uri","description":"URI identifying a page with human-readable information about the error."}}},"problemDetails":{"title":"Problem details","description":"Machine-readable details of an HTTP API error, conforming to RFC 9457.","type":"object","required":["type","title","status"],"properties":{"type":{"type":"string","format":"uri-reference","description":"URI reference identifying the problem type.","default":"about:blank"},"title":{"type":"string","description":"Short, human-readable summary of the problem type."},"status":{"type":"integer","format":"int32","minimum":400,"maximum":599,"description":"HTTP status code generated by the server."},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","format":"uri-reference","description":"URI reference identifying this occurrence of the problem."}}}},"responses":{"oauthBadRequest":{"description":"The OAuth request is malformed or contains an unsupported parameter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/oauthError"}}}},"oauthUnauthorized":{"description":"OAuth client authentication failed.","headers":{"WWW-Authenticate":{"description":"Authentication challenge as defined by the applicable OAuth authentication method.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/oauthError"}}}},"internalServerError":{"description":"The server was unable to process the request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetails"}}}}}}}
```

The format of `access_token` is not defined by this specification. The server MAY issue either an opaque token or a signed iSHARE JWT; in both cases the Service Consumer MUST treat the value as opaque and MUST NOT parse it.

{% hint style="info" %}
According to [RFC 6749](https://tools.ietf.org/html/rfc6749), scopes are case-sensitive.
{% endhint %}

Identity Providers have their own `/token` endpoint, which follows OpenID Connect conventions and differs from the M2M flow defined here.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://dev.ishare.eu/all-roles-common-endpoints/access-token-m2m.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
