Skip to main content

api-clients

add

Add an ApiClient directly to a Biobank. This is the most common action, and essentially joins up most of the other tool and some manual steps into a single command.

Command

  • api-clients add

Options

  • -g | --generate : Generate new ApiClient credentials and output them to the console after adding them to the Database
  • -i | --client-id <CLIENT-ID> : The Client Identifier. Required if --generate is not specified
  • -s | --client-secret <CLIENT-SECRET> : The Client Secret (not hashed). Required if --generate is not specified.
  • -n | --client-name <CLIENT-NAME> The Client Name. If omitted the Client ID will be used as a name.

Usage Scenarios

Typically, you probably just want to add a client for a given Biobank, have it auto generate the credentials and then tell you them so you can provide them to the person who needs them:

  • api-clients add --generate <BIOBANKID>

Or you might already have an ID and Secret, either generated by this tool or from elsewhere:

  • api-clients add --client-id <ID> --client-secret <SECRET> <BIOBANKID>

Client Secrets should be at least 128 bit strong cryptographically random strings. We store them hashed in the database. (This tool does the hashing, so you don't need to provide an already hashed secret).

Tips

  • biobankId is OrganisationId from the Organisations table.