Skip to content

Commit 6d29832

Browse files
committed
docs: update README for OAuth2 PKCE auth, remove username/password
Replace the Minimed CareLink setup docs with the new OAuth2 flow: - Remove CONNECT_CARELINK_USERNAME/PASSWORD from setup instructions - Document the nightscout-connect login command and DevTools paste flow - Add MONGO_CONNECTION requirement - Mention upcoming Nightscout admin UI integration
1 parent 5a34795 commit 6d29832

1 file changed

Lines changed: 37 additions & 12 deletions

File tree

README.md

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,8 @@ Where `subject.env` typically consists of something like this:
116116
CONNECT_API_SECRET=626753d7f62f000078e8f6e2
117117
CONNECT_NIGHTSCOUT_ENDPOINT=http://localhost:3030
118118
CONNECT_SOURCE=minimedcarelink
119-
CONNECT_CARELINK_USERNAME=your username
120-
CONNECT_CARELINK_PASSWORD=your password
121-
CONNECT_CARELINK_REGION=your region
122-
CONNECT_COUNTRY_CODE=your country code
119+
CONNECT_CARELINK_REGION=eu
120+
MONGO_CONNECTION=mongodb://localhost:27017/nightscout
123121
```
124122
125123
@@ -196,16 +194,43 @@ the `CONNECT_LINK_UP_PATIENT_ID` variable.
196194
197195
### Minimed Carelink
198196
199-
To synchronize from Medtronic Minimed Carelink, set the following
200-
environment variables.
197+
Medtronic CareLink now uses an OAuth2 PKCE flow — username and password authentication is no longer supported. Authentication requires a one-time login step to obtain OAuth tokens, which are then stored in MongoDB and refreshed automatically.
198+
199+
#### Setup
200+
201+
**Required environment variables:**
201202
* `CONNECT_SOURCE=minimedcarelink`
202-
* `CONNECT_CARELINK_USERNAME`
203-
* `CONNECT_CARELINK_PASSWORD`
204-
* `CONNECT_CARELINK_REGION` Either `eu` to set `CONNECT_CARELINK_SERVER` to
205-
`carelink.minimed.eu` or `us` to use `carelink.minimed.com`.
203+
* `MONGO_CONNECTION` — your MongoDB URI (same as Nightscout's `MONGO_CONNECTION`, no duplication needed)
204+
* `CONNECT_CARELINK_REGION` — `eu` (default) or `us`
205+
206+
`CONNECT_CARELINK_USERNAME` and `CONNECT_CARELINK_PASSWORD` are no longer used and can be removed from your config.
207+
208+
#### One-time login
209+
210+
Before starting the poller for the first time, run:
211+
212+
```bash
213+
nightscout-connect login # EU by default
214+
nightscout-connect login --region us
215+
```
216+
217+
This will open the CareLink login page in your browser. After logging in:
218+
219+
1. The page will **fail to load** — this is expected. CareLink redirects to a custom app scheme (`com.medtronic.carepartner://`) that the browser cannot handle
220+
2. Open DevTools (`F12`) → Network tab → find the blocked request to `/authorize/resume`
221+
3. Click it → Response Headers → copy the `Location` value (starts with `com.medtronic.carepartner:/sso?code=...`)
222+
4. Paste it back into the terminal when prompted
223+
224+
Tokens are saved to MongoDB and the poller can now start. Token refresh is handled automatically — you only need to re-run `login` if the refresh token expires (~30 days).
225+
226+
#### Nightscout admin UI (optional)
227+
228+
If you are running [cgm-remote-monitor](https://github.com/nightscout/cgm-remote-monitor), the login flow is also available directly from the Nightscout `/admin` page under **CareLink Authentication** — no CLI access needed.
229+
230+
#### Many to Many
206231

207-
For folks using the new Many to Many feature, please provide the username of the
208-
patient to follow using `CONNECT_CARELINK_PATIENT_USERNAME` variable.
232+
For folks using the Many to Many feature, provide the username of the patient to follow:
233+
* `CONNECT_CARELINK_PATIENT_USERNAME`
209234

210235
### Tidepool
211236

0 commit comments

Comments
 (0)