You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/oidc/getting-started-with-oauth2.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,10 +219,10 @@ sequenceDiagram
219
219
220
220
## 🧩 Step 1: Request OAuth 2.0 Client Credentials
221
221
222
-
1. Submit an [Application](/request-access) to obtain your `client_id` and confirm whether Quran Foundation provisioned the client as public or confidential.
222
+
1. Submit an [Application](/request-access) to obtain your OAuth client credentials: you will always receive a `client_id`, and confidential clients will also receive a `client_secret` for server-side use only.
223
223
2. Provide one or more exact `redirect_uri` values. These must match exactly at runtime.
224
224
225
-
> Most Request Access clients should let the frontend or native app start the login flow and generate PKCE, then use a backend for token exchange and refresh. Never embed `client_secret` in a browser or mobile app.
225
+
> Most Request Access clients should let the frontend or native app start the login flow and generate PKCE, then use a backend for token exchange and refresh. For confidential clients, keep the `client_secret` on the server only and never embed it in a browser or mobile app.
226
226
227
227
:::important Client Type Is Set During Provisioning
228
228
Hydra/Ory decides whether your client is public or confidential when Quran Foundation provisions the OAuth client, not when you write the integration code.
@@ -148,7 +153,7 @@ export default function App() {
148
153
}
149
154
```
150
155
151
-
If Quran Foundation provisioned your client as public with `token_endpoint_auth_method=none`, you can swap the backend call above for a direct `exchangeCodeAsync(...)` call in the app.
156
+
If Quran Foundation provisioned your client as public with `token_endpoint_auth_method=none`, you can swap the backend call above for a direct `exchangeCodeAsync(...)` call in the app using the same `discovery.tokenEndpoint`.
152
157
153
158
👉 **[Full React Native Example Repo](https://github.com/quran/oauth2-react-native-client-example)** shows the direct public-client variant
// Treat logout as best effort so the app can still clear local state.
335
+
}
336
+
337
+
res.status(204).send();
338
+
});
339
+
309
340
app.listen(3000, () => {
310
341
console.log("QF backend exchange service running on http://localhost:3000");
311
342
});
312
343
```
313
344
314
-
If you already use backend sessions, keep the `refresh_token` on the server and return only the short-lived access token and decoded user profile to the app.
345
+
If you already use backend sessions, keep the `refresh_token` on the server and return only the short-lived access token and decoded user profile to the app. In that setup, `/api/auth/qf/logout` should revoke and clear the server-stored refresh token instead of expecting it from the app.
0 commit comments