For "POST username+password -> get token" APIs, including the OAuth2 password grant. There's no UI on the device. Credentials come from config.json, which your plugin.js writes.
"token": { "file": "token.json" },
"config": { "file": "config.json" },
"auth": {
"type": "password",
"request": {
"url": "{cfg.server}/oauth/v2/token",
"method": "POST",
"headers": { "Content-Type": "application/json" },
"body": "{\"grant_type\":\"password\",\"client_id\":\"{cfg.client_id}\",\"client_secret\":\"{cfg.client_secret}\",\"username\":\"{cfg.username}\",\"password\":\"{cfg.password}\"}"
},
"token_path": "access_token"
}
- Runs when there's no token, and again automatically on any 401/403 (from browse, lists or download; it retries once).
- Needs a token block. Without a token file to save into, minting fails.
Without an auth block, a missing or rejected token shows a screen that sends the user to the web UI.