OAuth2 Client Setup
Purpose: Explain how to create and configure your OAuth2 client. Use this when: You are creating an app or updating client settings. Do not use this when: Your client is already provisioned and you only need SDK code. Backend required: Not for setup itself. Allowed runtimes: Any. Required credentials: None yet. Minimal import: None.
Configure Your App in Developer Console
Create an app or open an existing app in Developer Console, then sign in with your Quran Foundation account. The console issues credentials for the prelive and production environments and lets you:
- rotate your client secret;
- add each exact redirect URI and post-logout redirect URI separately; and
- request the API scopes your app needs and track their status.
Choose the App Type
The app type selected in Developer Console determines the OAuth2 client type:
- Backend/server app: A confidential client with a one-time
client_secret. Keep the secret on the backend or BFF, exchange the code there, refresh the session there, and store tokens server-side. The browser should never hold the secret, even if the frontend runs on the edge. - Frontend or mobile app: A public client with no
client_secret. Exchange the code using PKCE, and sendclient_idwithout client authentication when refreshing.
Check the app type in Developer Console instead of guessing which flow to use.