@lunch-money/developer-docs 2.11.2-preview.7 → 2.11.2-preview.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -25,7 +25,7 @@ Use a sample application to see Lunch Money OAuth working end to end before you
|
|
|
25
25
|
> The sample uses a fixed demonstration user and in-memory stores. It does not provide real application authentication, durable multi-user isolation, production credential storage, deployment configuration, or operational controls. Review its [security guidance](https://github.com/lunch-money/lm-oauth-confidential-node-example/blob/main/SECURITY.md) and [production checklist](https://github.com/lunch-money/lm-oauth-confidential-node-example/blob/main/PRODUCTION_CHECKLIST.md) before adapting any part of it.
|
|
26
26
|
|
|
27
27
|
<!-- BEGIN GENERATED OAUTH SAMPLE WALKTHROUGH -->
|
|
28
|
-
<!-- Source: lunch-money/lm-oauth-confidential-node-example@
|
|
28
|
+
<!-- Source: lunch-money/lm-oauth-confidential-node-example@567516d5e32d89576323119bec7f40a7bee007b7:docs/WALKTHROUGH.md -->
|
|
29
29
|
## Try OAuth with your Lunch Money account
|
|
30
30
|
|
|
31
31
|
Use this walkthrough to authorize a real Lunch Money OAuth client, call the Lunch Money API, optionally refresh its credentials, revoke access, and repeat the flow. The sample is a confidential, server-side web client built with Node.js and TypeScript.
|
|
@@ -100,11 +100,11 @@ export OAUTH_REDIRECT_URI='http://localhost:4002/oauth/callback'
|
|
|
100
100
|
export LUNCH_MONEY_API_BASE_URL='{{LUNCH_MONEY_API_BASE_URL}}'
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
The Developer Portal replaces `{{LUNCH_MONEY_API_BASE_URL}}` with the API base URL for the environment where you registered the client. If you are reading this walkthrough in the sample repository, use the API base URL
|
|
103
|
+
The Developer Portal replaces `{{LUNCH_MONEY_API_BASE_URL}}` with the API base URL for the environment where you registered the client, so the alpha guide configures alpha explicitly. If you are reading this walkthrough in the sample repository with a production client, omit the `LUNCH_MONEY_API_BASE_URL` export; the sample defaults to `https://api.lunchmoney.dev`. For a beta or alpha client, use the exact URL supplied by Lunch Money. The client registration and API base URL must belong to the same environment. The sample uses that value for OAuth discovery, token operations, and Lunch Money API requests. A real application should also use [OAuth discovery](https://lunchmoney.dev/oauth/authorization-code#configure-lunch-money-with-discovery) instead of hard-coding authorization, token, and revocation endpoint URLs. `PORT` is optional and defaults to `4002`.
|
|
104
104
|
|
|
105
105
|
`SESSION_SECRET` is also optional for this local sample. If it is absent, the process creates a new random cookie-signing secret when it starts. Because all browser sessions, authorization attempts, and credentials are held in memory and cleared on restart, the generated secret can be cleared at the same time. A production application must instead provide a strong `SESSION_SECRET`, keep it stable across restarts, and not rotate it for each OAuth authorization.
|
|
106
106
|
|
|
107
|
-
Alternatively, copy [
|
|
107
|
+
Alternatively, copy [`env.example`](https://github.com/lunch-money/lm-oauth-confidential-node-example/blob/567516d5e32d89576323119bec7f40a7bee007b7/env.example) to `.env` as described in [Load settings from a `.env` file](https://github.com/lunch-money/lm-oauth-confidential-node-example/blob/567516d5e32d89576323119bec7f40a7bee007b7/README.md#load-settings-from-a-env-file).
|
|
108
108
|
|
|
109
109
|
> [!WARNING]
|
|
110
110
|
> **Keep credentials private**
|
|
@@ -195,7 +195,7 @@ When access is still active, revoke it first through **Disconnect active budget*
|
|
|
195
195
|
|
|
196
196
|
After the flow succeeds, connect each action you performed to the code that implemented it, then decide how those responsibilities fit into your own application.
|
|
197
197
|
|
|
198
|
-
Before adapting the code, read the repository's [OAuth code guide](https://github.com/lunch-money/lm-oauth-confidential-node-example/blob/
|
|
198
|
+
Before adapting the code, read the repository's [OAuth code guide](https://github.com/lunch-money/lm-oauth-confidential-node-example/blob/567516d5e32d89576323119bec7f40a7bee007b7/src/oauth/README.md), [security model](https://github.com/lunch-money/lm-oauth-confidential-node-example/blob/567516d5e32d89576323119bec7f40a7bee007b7/SECURITY.md), [production checklist](https://github.com/lunch-money/lm-oauth-confidential-node-example/blob/567516d5e32d89576323119bec7f40a7bee007b7/PRODUCTION_CHECKLIST.md), and [troubleshooting guide](https://github.com/lunch-money/lm-oauth-confidential-node-example/blob/567516d5e32d89576323119bec7f40a7bee007b7/TROUBLESHOOTING.md).
|
|
199
199
|
<!-- END GENERATED OAUTH SAMPLE WALKTHROUGH -->
|
|
200
200
|
|
|
201
201
|
## Understand the confidential teaching code
|
|
@@ -237,6 +237,19 @@ visible or selectable. Applications that add their own sign-in system must put
|
|
|
237
237
|
that pair inside the authenticated application user's storage and ownership
|
|
238
238
|
boundary.
|
|
239
239
|
|
|
240
|
+
The native sample defaults to the production API at
|
|
241
|
+
`https://api.lunchmoney.dev`. This Developer Portal is configured for
|
|
242
|
+
`{{LUNCH_MONEY_API_BASE_URL}}`. If this differs from production, set the
|
|
243
|
+
sample's API-base override before starting it:
|
|
244
|
+
|
|
245
|
+
```sh
|
|
246
|
+
export EXPO_PUBLIC_LUNCH_MONEY_API_BASE_URL='{{LUNCH_MONEY_API_BASE_URL}}'
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Register the OAuth client in the same environment as that API base URL. A
|
|
250
|
+
client registration from one environment cannot be used with another
|
|
251
|
+
environment's authorization server and API.
|
|
252
|
+
|
|
240
253
|
The native repository's [walkthrough](https://github.com/lunch-money/lm-oauth-native-expo-example/blob/main/docs/WALKTHROUGH.md) is the canonical hands-on guide;
|
|
241
254
|
complete the registration, development-build, authorization, `/v2/me`,
|
|
242
255
|
optional refresh, revocation, and local-reset walkthrough there.
|