Keycloak OIDC logo

REST API integration

Keycloak OIDC REST API integration for Draftbit

Connect to Keycloak OpenID Connect realms

What is Keycloak OIDC?

Keycloak exposes standards-based OIDC endpoints per realm. Use Authorization Code with PKCE for frontend apps, and use the discovery document to confirm issuer configuration.

Use Keycloak OIDC with Draftbit

  • Built-in endpoints: Get discovery document, Exchange authorization code, Get userinfo, Get JWKS.
  • Bind any Keycloak OIDC endpoint to a screen, list, form, or AI agent action.
  • Authentication is configured once per app — secrets stay on the server.
  • Add custom request and response transforms without forking Keycloak OIDC's client library.

Example

keycloak-oidc-example.ts
// Example: fetch from Keycloak OIDC
const response = await fetch("https://{keycloak_host}/realms/{realm}/.well-known/openid-configuration", {
  headers: {
    "Authorization": "Bearer YOUR_KEYCLOAK_OIDC_TOKEN",
  },
});
const data = await response.json();

Use cases

  • Add sign-up, sign-in, and password reset flows to a mobile app
  • Gate premium features behind authenticated user sessions
  • Sync user profiles across web and native clients

Authentication

Authentication uses the `Authorization` header. Paste your key once in Draftbit and every request to Keycloak OIDC carries it automatically — secrets stay on the server side.

Use Keycloak OIDC in a Draftbit app today

Start free, connect Keycloak OIDC in minutes, and ship with AI agents that know how to use it.

Start building free

Frequently asked questions

What is the Keycloak OIDC REST integration?

Keycloak exposes standards-based OIDC endpoints per realm. Use Authorization Code with PKCE for frontend apps, and use the discovery document to confirm issuer configuration.

How do I connect Keycloak OIDC to a Draftbit app?

Go to Integrations and then REST APIs in your Draftbit app and pick Keycloak OIDC from the catalog. Paste your API key or token and fill in any base URL variables, such as a project ID or host. The endpoints are then available across your screens and to the AI agents while you build.

Does Keycloak OIDC require authentication?

Most Keycloak OIDC endpoints expect a key or token sent as a header. The preconfigured endpoints include Get discovery document, Exchange authorization code, Get userinfo, Get JWKS.

What can I build with Keycloak OIDC and Draftbit?

Most teams use Keycloak OIDC as a authentication service for a mobile or web app. You might use Keycloak OIDC to add sign-up, sign-in, and password reset flows to a mobile app, or to gate premium features behind authenticated user sessions.

Related Integrations

Get started free Browse all Integrations