Authentication
Some LAPIS instances require authentication to access their data. If an instance is configured with authentication, you need to include a valid access token in your requests.
Checking if Authentication is Required
Section titled “Checking if Authentication is Required”Try accessing any endpoint without authentication:
curl https://lapis.cov-spectrum.org/open/v2/sample/info -vIf authentication is required,
you’ll receive a 401 Unauthorized response and the output will contain something like
> ...< HTTP/1.1 401< ...If the instance is open (no authentication), you’ll receive the normal response data.
Getting an Access Token
Section titled “Getting an Access Token”Contact the LAPIS instance administrator to learn how to obtain an access token. The method depends on the identity provider configured for that instance. Common methods include:
- Username/password - Exchange credentials for a token
- Client credentials - Use a client ID and secret
- OAuth 2.0 flows - Authorization code, device flow, etc.
Making Authenticated Requests
Section titled “Making Authenticated Requests”To make authenticated requests to LAPIS,
include the access token in the Authorization header using the Bearer scheme:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" https://lapis.cov-spectrum.org/open/v2/sample/aggregated