The tokens
site app enables users to issue and manage access tokens for REST API views used on your SODAR Core based Django site.
Users can use this app to create and delete access tokens. These can be set to expire or work until deleted.
Warning
To install this app you must have the django-sodar-core
package installed and the projectroles
app integrated into your Django site. See the projectroles integration document <app_projectroles_integration>
for instructions.
The siteinfo app is available for your Django site after installing django-sodar-core
. Add the app into THIRD_PARTY_APPS
as follows:
THIRD_PARTY_APPS = [
# ...
'tokens.apps.TokensConfig',
]
In the Django URL configuration file, add the following line under urlpatterns
to include siteinfo URLs in your site.
urlpatterns = [
# ...
url(r'^tokens/', include('tokens.urls')),
]
To register the siteinfo site app plugin, run the following management command:
$ ./manage.py syncplugins
You should see the following output:
Registering Plugin for tokens.plugins.SiteAppPlugin
When logged in to SODAR, you can find the "API Tokens" link in your user dropdown menu in the top right corner of the site.
Select "Create Token" from the "Token Operations" dropdown to create a new token. You will only see the token once, so make sure to copy it to clipboard at this point.
Deleting existing tokens can be done from the token list.