Skip to content

Commit 82b038b

Browse files
Clarify App token usage (#567)
* Update index.md * Enhance documentation for App Token authentication Added example for using App Token authentication with curl. * Update index.md * Update index.md typoz
1 parent a815591 commit 82b038b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • versioned_docs/version-4.0/dev/server/apis/http/graph

versioned_docs/version-4.0/dev/server/apis/http/graph/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,16 @@ For development purposes the examples in the developer documentation use Basic A
6363

6464
To authenticate with a Bearer token or OpenID Connect access token replace the `-u user:password` Basic Auth option of curl with a `-H 'Authorization: Bearer <token>'` header. A `<token>` can be obtained by copying it from a request in the browser, although it will time out within minutes. To automatically refresh the OpenID Connect access token an ssh-agent like solution like [oidc-agent](https://github.com/indigo-dc/oidc-agent) should be used. The graph endpoints that support a preconfigured token can be found in the [API specification](https://github.com/opencloud-eu/libre-graph-api)
6565

66+
#### Authorization with App token
67+
68+
Users can create an App Token in their Open Cloud interface. This token can be used to authenticate a user using the Account Name for the username and the token as password. Here is an example using curl
69+
70+
```sh
71+
curl 'https://cloud.opencloud.test/graph/v1.0/me' -H 'accept: application/json' -u 'accountname:the generated app token'
72+
73+
# or using the Authentification Basic Header
74+
# Authentification: Basic BASE64(username + ':' + app token)
75+
curl 'https://cloud.opencloud.test/graph/v1.0/me' -H 'accept: application/json' -H 'Authorization: Basic YWNjb3VudG5hbWU6dGhlIGdlbmVyYXRlZCBhcHAgdG9rZW4='
76+
```
77+
6678
## Resources

0 commit comments

Comments
 (0)