Authentication methods
To specify the authentication method of your compute server you must provide a special environment variable AUTH_METHOD
. Depending on what authentication method you chose, there may be other more detailed options be available to further configure the authentication.
In the SDK you will have to set your headers depending on what Authentication method you are using like so (static Bearer token in this example):
new Pictofit.ComputeServer(<MY-SERVER-URL>, {
Authorization: "Bearer <MY-STATIC-TOKEN>"
});
Disable authentication
AUTH_METHOD=public
To disable the authentication of request to the compute server, you must set AUTH_METHOD
to public
. That means every endpoint of the server is accessible by anyone. Only recommended for testing!
Static
AUTH_METHOD=static
A static auth token will be used to authenticate requests. The token used will be read from another env variable AUTHENTICATION_TOKEN
. This is auth token which needs to be passed in the header of each request sent to the compute server. This token uses the bearer scheme.
OIDC
AUTH_METHOD=oidc
The introspection_endpoint
of a defined AUTH_METHOD_OIDC_SERVER_BASE_URL
will be called and send a POST request with AUTH_METHOD_OIDC_CLIENT_ID + ":" + AUTH_METHOD_OIDC_CLIENT_SECRET
as base authentication header. With the AUTH_METHOD_OIDC_CHECKS
you can define a JsonPath expression which needs to be matched.
Parameter | Description |
---|---|
| Parameter to define the base URL of the OIDC Server. |
| Parameter to define the client Id to retrospect. |
| Parameter to define the client Secret to retrospect. |
| Parameter to define an object with an JsonPath which needs to be matched.
|
Webhook
AUTH_METHOD=webhook
The defined AUTH_METHOD_WEBHOOK_URL
gets called and the response gets checked if the response is ok(= Ok means if the response code is lower that 400).