Most Amphora Data API calls must be authenticated. The Amphora Data API accepts JSON Web Tokens (JWTs) to authenticate requests. There are two ways to acquire a JWT.
Authenticate using the Authentication API
This option may be removed in the future.
You should choose this option if you need to acquire a token without user interaction.
As you can see, this option requires plaintext access to a username/ password. As such, this authentication option is not preferred from a security perspective.
Authenticate using OAuth
This authentication option requires a paid Amphora Data account
To authenticate using OAuth, you need to register your application. Registering your application has two important effects:
identity.amphoradata.combecomes aware of your application, and will allow users to login to it by recirecting back to your web application via the OAuth Code flow.
api.amphoradata.combecomes aware of your application, and will allow cross origin requests from your domain.
We recommend using
react-amphorato handle the Authentication process for react apps.
Using the JWT
Once you've acquired a JWT, it must be included in every request to the Amphora Data API for that request to be authenticated. When using Axios, you can add the token to the default client like so: