| Authentication and Authorization |
291
<value>token</value>
</in>
<out>
<value>token</value>
</out>
</transfer>
<token>
<encryption_key>gj5o930t78m34ejme9dx</encryption_key>
</token>
</authorization>
<file_system>
...
...
</file_system>
</user>
You can also configure token-authorization settings in a
<group>
section to be applied to all users in the
group or in the
<default>
section to apply them globally for all users. For instructions on how to run
asconfigurator
commands to do so, as well as to view other token configuration options, see
on page 315.
Transfer Token Creation (Node API)
Aspera recommends using the Node API tool to generate transfer tokens, though they can be generated using the
astokengen
tool. Using the Node API tool enables greater flexibility and functionality because
astokengen
creates tokens constrained by the settings in
aspera.conf
.
Note:
Transfer tokens for use with Ascp 4 must be created with
astokengen
. Otherwise,
astokengen
is
most useful for decoding tokens during application development for debugging purposes. For more information on
astokengen
, see
Transfer Token Generation (astokengen)
on page 293.
Prerequisites:
In order to create transfer tokens with the Node API, you must set up HST Server for the Node API. For instructions,
on page 272.
Creating Transfer Tokens with Node API Calls
Curl is used to call the API, and is freely available for download for all operating systems supported by Aspera:
To generate a token, run a curl command to the
/files/upload_setup
or
/files/download_setup
endpoint (depending on what kind of token you want to generate). The request body includes a JSON object called
the
transfer_requests
. The Node API output response, a
transfer_specs
JSON object, includes a token,
as well as a description of who is authorized to transfer using the token, what files can be transferred, and transfer
properties.
Note:
When generating tokens with an IBM Aspera Shares server, the endpoints are
/node_api/files/
upload_setup
and
/node_api/files/download_setup
.
Upload token
General syntax:
# curl -i -X POST -u
node_username
:
node_user_password
-d
'{"transfer_requests" : [{"transfer_request" : { "paths" : [{}],
"destination_root" : "/" } } ] }";' http(s)://
node_server
:
node_port
/files/
upload_setup
This command specifies the following: