Skip to content

Commit 51f7089

Browse files
Pablo Paneroppanero
authored andcommitted
add token obtention through cli
1 parent 7c977b5 commit 51f7089

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/develop/make_it_your_own.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,16 @@ in the dropdown menu of the username (top-right), select `Applications`. Then
421421
click on `New token`, name your token and click `Create`. Copy this token (we
422422
will refer to it as `<your token>`) and put it in the API call as such:
423423

424+
Alternatively, you can get a token using the invenio command, where `-n` is
425+
the name of the token (your choice) and `-u` the email of the user created
426+
right before.
427+
428+
``` bash
429+
pipenv run invenio tokens create -n permission-demo -u [email protected]
430+
```
431+
432+
Then use the obtained token to perform the query:
433+
424434
``` bash
425435
curl -k -XPOST -H "Authorization:Bearer <your token>" -H "Content-Type: application/json" https://localhost:5000/api/records/ -d '{
426436
...<fill with the above>...

0 commit comments

Comments
 (0)