Client credentials applications are externally hosted OAuth or OSDK applications that use client credentials for authentication. These applications are ideal for pro-code solutions that require maximum user scale and allow customer-defined authentication and authorization logic outside of Foundry.
Client credentials applications are ideal for the following use cases:
Client credentials applications authenticate using a client ID and client secret. They then receive an access token tied to a service user and use that token to make API calls to Foundry through the service user's permissions.
External application → OAuth Client Credentials → Service user → Foundry APIs
Before setting up a client credentials application, ensure that you have the following:
OAuth clients are now created in Developer Console. Refer to the comprehensive OAuth client guide for more information.
For client credentials applications, Foundry creates a service user that acts on behalf of your application. This offers the following benefits:
After creating the OAuth client, configure the following permissions for the service user:
For TypeScript applications, use the OSDK to generate a custom SDK library for your application. Refer to the bootstrapping server-side TypeScript applications guide for more information.
The OSDK bootstrapping process consists of the following steps:
The OSDK client provides type safety, automatic serialization, and simplified API interactions compared to raw REST API calls.
When using a client credentials grant, remember to keep the OAuth2 client secret secure. Never store secrets in public code repositories, or within publicly accessible code in an application.
If a secret is exposed, rotate the secret immediately.
You now have a working client credentials application with the power of the Ontology at your fingertips. Your external application can securely access Foundry data and functionality through the service user's permissions, enabling you to build scalable consumer-facing applications with robust backend integration.