# Integrate two applications: one for the mobile application and the other for entity verification via Keycloak.

**URL:** <https://community.auth0.com/t/integrate-two-applications-one-for-the-mobile-application-and-the-other-for-entity-verification-via-keycloak/206046>\
**Category:** Get Help\
**Tags:** application\
**Created:** [November 30, 2026, 11:26am UTC](https://community.auth0.com/t/integrate-two-applications-one-for-the-mobile-application-and-the-other-for-entity-verification-via-keycloak/206046 "2026-11-30T11:26:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmarzolf](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lmarzolf/32/82073_2.png) [@lmarzolf](https://community.auth0.com/u/lmarzolf)\
**Post date:** [November 30, 2026, 11:26am UTC](https://community.auth0.com/t/integrate-two-applications-one-for-the-mobile-application-and-the-other-for-entity-verification-via-keycloak/206046/1 "2026-11-30T11:26:13Z")

</div>

Hello,

We have a mobile application that authenticates users directly through **Auth0** , using Authorization Code Flow with PKCE.

Authentication works correctly.

However, our application needs to access a third-party DataHub API protected by **Keycloak** , with individual permissions for each user.

Our desired flow is:

**Mobile App → Auth0 (authentication) → Keycloak (user authorization) → DataHub API**

We want to keep Auth0 as the main authentication system without requiring users to log in again through Keycloak.

My questions are:

1. Can Keycloak recognize or exchange an Auth0 token to issue its own access token?

2. What needs to be configured in Auth0 (audience, application, scopes, etc.)?

3. What information should we exchange with the Keycloak provider?

We would like to minimize changes to our existing Auth0 authentication flow.

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [November 30, 2026, 10:32pm UTC](https://community.auth0.com/t/integrate-two-applications-one-for-the-mobile-application-and-the-other-for-entity-verification-via-keycloak/206046/3 "2026-11-30T22:32:21Z")

</div>

Hi @lmarzolf

Welcome to the Auth0 Community!

I understand you are looking for configuration advice when it comes to implementing the following flow where Auth0 is the main authentication system: Mobile App → Auth0 (authentication) → Keycloak (user authorization) → DataHub API.

**Overview**

Yes, this architecture is fully supported without requiring users to log in again. You can achieve this using **[Custom Token Exchange](https://auth0.com/docs/authenticate/custom-token-exchange)** or **[JSON Web Tokens](https://auth0.com/docs/secure/tokens/json-web-tokens)**.

Auth0 remains your primary authentication authority, while Keycloak acts as an Identity Broker and authorization engine that validates the Auth0 token and mints its own token for the DataHub API.

### Official Recommendations

#### 1. Can Keycloak recognize or exchange an Auth0 token to issue its own access token?

**Yes.** Keycloak supports \*\*External-to-Internal Token Exchange \*\*:

- **How it operates:** Keycloak registers Auth0 as an external [OpenID Connect (OIDC) Identity Provider](https://auth0.com/docs/get-started/applications/configure-applications-with-oidc-discovery).

- **The Exchange:** After your mobile app authenticates against Auth0, it (or your backend proxy) makes a non-interactive HTTP `POST` request directly to Keycloak’s token endpoint. Keycloak validates the Auth0 signature against Auth0’s JWKS endpoint, links or auto-provisions the user (Just-in-Time provisioning), and mints a local Keycloak access token populated with the user’s DataHub roles and permissions.

### 2. What needs to be configured in Auth0?

To keep changes to your current PKCE implementation to a minimum, configure the following in Auth0:

#### A. Register a Custom API (Audience)

- **Why:** By default, Auth0 issues an **opaque token** for mobile logins unless an API `audience` is requested. Keycloak requires a cryptographically signed **JWT**.

- **Configuration:** In **Auth0 Dashboard \> Applications \> APIs** , click **Create API** :

#### B. Update Mobile App Authorization Request

- Append the `audience` parameter to your existing PKCE `/authorize` call alongside standard scopes.

#### C. Add Custom Claims via Post-Login Action (If Needed)

- If Keycloak or the DataHub API requires user attributes not included in standard OIDC claims (e.g., tenant IDs, organizational roles), attach them using an Auth0 Post-Login Action with [**namespaced custom claims**](https://auth0.com/docs/secure/tokens/json-web-tokens/create-custom-claims):

```auto
exports.onExecutePostLogin = async (event, api) => {
  const namespace = 'https://datahub.keycloak.local/';
  if (event.authorization?.roles) {
    api.accessToken.setCustomClaim(`${namespace}roles`, event.authorization.roles);
  }
};

```

### 3. What information should be exchanged with the Keycloak provider?

#### Information You Must Provide to Keycloak (Auth0 ➔ Keycloak)

Keycloak requires these parameters to configure Auth0 as an trusted external Identity Provider (IdP) and verify incoming tokens:

- **OIDC Discovery URL:** `https://{your-tenant}.auth0.com/.well-known/openid-configuration`

- **JWKS URI:** `https://{your-tenant}.auth0.com/.well-known/jwks.json`

- **Issuer URL (`iss`):** `https://{your-tenant}.auth0.com/`

- **Audience (`aud`):** Your configured Auth0 API Identifier (e.g., `https://datahub.keycloak.local`) or the Mobile Client ID (if you are exchanging an ID Token instead of an Access Token).

- **Identity Mapping Claim:** Typically set to `sub` (representing the unique Auth0 user ID `auth0|...`) or `email`.

#### Information You Must Receive from Keycloak (Keycloak ➔ Mobile App / Backend)

Your development team needs these variables to point the mobile application (or backend client proxy) to Keycloak’s token endpoint for exchange:

- **Keycloak Token Endpoint:** `https://{keycloak-host}/realms/{realm}/protocol/openid-connect/token`

- **Identity Provider (IdP) Alias:** The unique identifier assigned to Auth0 when registered inside the Keycloak admin panel.

- **Keycloak Client ID:** The Client ID created within Keycloak that represents your application context.

- **Target Scope / Audience:** The specific scopes or target Client ID needed for the DataHub API.

We hope the above information helped implement your desired flow!

Have a great one,  
Gerald
