Server-to-server Authentication
Instead of obtaining access token using the OAuth 2.0 flow, you can call Authcore API using a signed JWT directly as a bearer token, . You can avoid having to make a network request before making an API call. To do so:
Generate an EC private key, of size 256, and output it to a file named
key.pem
:Extract the public key from the key pair:
Update Authcore config file, set
service_account_public_key
to the public key andservice_account_id
to the ID of the user that act as a service account.Using any standard JWT library, such as one found at jwt.io, create a JWT with ES256 algorithm and payload like the following example:
Sign the JWT with
prime256v1
using the above private key.For example (Javascript):
Call the API, using the signed JWT as the bearer token:
Last updated