# TokenGrant

{% embed url="<https://trovi.chameleoncloud.org/docs/swagger#/token/token_create>" %}
View schema and examples
{% endembed %}

Users must obtain an authentication token from one of the supported Trovi identity providers, and then submit that **subject token** to the TokenGrant endpoint in order to obtain a **Trovi token**. All Trovi tokens adhere to the following properties:

* Expire 5 minutes after they are issued
* Are in the JWT format (JWS string)

Token requests adhere to the following properties:

* [RFC 8693 - OAuth 2.0 Token Exchange](https://datatracker.ietf.org/doc/html/rfc8693)
* The only supported grant type is `"token_exchange"`
* Subject tokens must be in the JWT format (JWS string)

The following scopes are available for all Trovi tokens. Currently, any requested scopes will be granted to any user. This is subject to change.&#x20;

* `artifacts:read` - Read all artifacts which are accessible to the user
* `artifacts:write` - Edit all artifacts for which the user is an owner or author, and create new artifacts
* `artifacts:write_metrics` - Update artifact access metrics


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chameleoncloud.gitbook.io/trovi/api-reference/token/tokengrant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
