Skip to main content

Overview

The amberSearch Public API uses OAuth 2.0 Authorization Code Grant and a PKCE safety measure to authenticate third-party applications. This flow allows users to authorize external applications to access amberSearch on their behalf without sharing their credentials. The provider abides by the specifications defined in the RFC 6749 and RFC 7636 protocols, implementing a seamless and secure interface for authorizing users.
This is a beta version of our OAuth 2.0 implementation. Features may evolve as we continue to improve the API.

Base URL

All OAuth endpoints are available under:

OAuth 2.0 Flow

The OAuth 2.0 Authorization Code Grant flow consists of the following steps:
1

Client Redirects User to Authorization Endpoint

Your application redirects the user to /api/oauth/authorize with your client credentials and desired scopes.
2

User Authentication

The user authenticates with amberSearch (if not already logged in) and authorizes your application.
3

Authorization Code Issued

amberSearch redirects back to your application’s redirect URI with an authorization code.
4

Exchange Code for Access Token

Your application exchanges the authorization code for an access token by calling /api/oauth/token.
5

Access API with Token

Use the access token to make authenticated requests to amberSearch API endpoints.

Getting Started

To use OAuth 2.0 with the amberSearch API, you need OAuth client credentials client_id, client_secret or simply client_id if PKCE is required.
OAuth client credentials can only be obtained from the amberSearch team. Contact your dedicated customer success manager to request your credentials. You cannot generate these credentials yourself.

Discovery Endpoints

To make integration easier, amberSearch exposes OAuth discovery endpoints so clients can automatically learn: • the authorization endpoint (/authorize) • the token endpoint (/token) • supported PKCE methods • supported scopes

Authorization Endpoint

Step 1: Redirect User to Authorization

Direct users to the authorization endpoint to begin the OAuth flow:
Query Parameters: Example Authorization URL:

Step 2: User Authentication

If the user is not logged into amberSearch, they will be redirected to the login page. After successful authentication, they are redirected back to continue the OAuth flow.

Step 3: Authorization Response

Upon successful authorization, the user is redirected to your redirect_uri with:
Error Response:

Token Endpoint

Step 4: Exchange Authorization Code for Access Token

Request Body (form-encoded): Example Request:
Success Response:
Success Response (with offline_access scope):

Using the Access Token

Once you have an access token, include it in the Authorization header for all API requests:

Step 5: Exchanging the refresh token for an access token

In case of the access token expiring or for rotating the tokens you can pass the refresh token in order to retrieve a new access and refresh token curl -X POST “https://customerDomain.ambersearch.de/api/oauth/token
-H “Content-Type: application/x-www-form-urlencoded”
-d “client_id=client_id”
-d “client_secret”=“client_secret”
-d “grant_type=refresh_token”
-d “refresh_token=your-refresh-token”
Success Response:
Success Response (with offline_access scope):

Scopes

Token Expiration:
  • Standard tokens: Expire after 1 hour (expires_in: 3600)
  • Offline access tokens: Never expire (expires_in: null)
For long-running applications or background processes, request the offline_access scope to avoid token expiration issues.

Error Handling

Common OAuth errors: Example Error Response:

Security Best Practices

  • Always use HTTPS for redirect URIs
  • Validate the state parameter to prevent CSRF attacks
  • Rotate access tokens regularly if not using offline_access
  • Switch between the code_verifier strings constantly
  • Never expose tokens in URLs or logs