Authentication with Auth0
The Pasqal Cloud platform uses Auth0 for authentication. You can retrieve tokens directly for custom integrations.
Overview
Section titled “Overview”Authentication tokens are required to interact with Pasqal public APIs. There are two methods to obtain tokens depending on your use case:
- User Authentication: For individual users with email and password
- Service Account Authentication: For third-party integrations using client credentials
User Authentication
Section titled “User Authentication”Individual users can retrieve an access token using their email and password credentials.
Using cURL
Section titled “Using cURL”curl --request POST \ --url https://pasqal.eu.auth0.com/oauth/token \ --header 'Content-Type: application/json' \ --data '{ "client_id": "eiSaMfiINjiaXr0tnc2Bh1Mr6XPQ1BDK", "username": "{{user_email}}", "password": "{{user_password}}", "audience": "https://apis.pasqal.cloud/account/api/v1", "scope": "openid profile email", "realm": "pcs-users", "grant_type": "http://auth0.com/oauth/grant-type/password-realm" }'Request Parameters
Section titled “Request Parameters”| Parameter | Description |
|---|---|
client_id | The application client identifier |
username | Your registered email address |
password | Your account password |
audience | The target API endpoint |
scope | Requested permissions (openid, profile, email) |
realm | Authentication realm for users |
grant_type | OAuth grant type for password authentication |
Service Account Authentication
Section titled “Service Account Authentication”Pasqal may provide a service account for machine-to-machine interactions between clients/third-parties and Pasqal cloud services. A token can then be generated without a username and password.
Using cURL
Section titled “Using cURL”curl --request POST \ --url https://pasqal.eu.auth0.com/oauth/token \ --header 'Content-Type: application/json' \ --data '{ "client_id": "{{service_account_client_id}}", "client_secret": "{{service_account_client_secret}}", "audience": "https://apis.pasqal.cloud/account/api/v1", "grant_type": "client_credentials" }'Request Parameters
Section titled “Request Parameters”| Parameter | Description |
|---|---|
client_id | Service account client identifier |
client_secret | Service account secret key |
audience | The target API endpoint |
grant_type | OAuth grant type for client credentials |
Response Format
Section titled “Response Format”A successful authentication request returns a JSON response containing:
{ "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6...", "scope": "openid profile email", "expires_in": 86400, "token_type": "Bearer"}Response Fields
Section titled “Response Fields”| Field | Description |
|---|---|
access_token | JWT token to authenticate API requests |
token_type | Token type (always “Bearer”) |
expires_in | Token validity duration in seconds |
scope | Granted permissions |
Using the Token
Section titled “Using the Token”Include the access token in the Authorization header for all API requests:
curl --request GET \ --url https://apis.pasqal.cloud/service/api/version/endpoint \ --header 'Authorization: Bearer {{access_token}}'