diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8da9660ab..e60774e8a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,6 +51,22 @@ export APIFY_CONSOLE_URL=http://localhost:3000 Note that if `APIFY_CONSOLE_URL` points at `localhost`, `apify login` validates your token against `http://localhost:3333`. All other commands still call the production API at `https://api.apify.com`. +### `APIFY_CLI_OAUTH_ISSUER_URL` + +The OAuth 2.0 authorization server `apify login` talks to. The CLI fetches its RFC 8414 metadata from `/.well-known/oauth-authorization-server` and uses the device authorization, authorization and token endpoints it lists. + +The default value is `https://console-backend.apify.com`. + +### `APIFY_CLI_OAUTH_CLIENT_ID` + +The OAuth 2.0 client ID of the CLI. It is the URL of a hosted client metadata document describing the CLI as a public native client. + +The default value is `https://apify.com/.well-known/oauth-clients/apify-cli.json`. To test against a differently hosted document, for example a key-value store record, point the variable at its URL: + +```bash +export APIFY_CLI_OAUTH_CLIENT_ID='https://api.apify.com/v2/key-value-stores//records/oidc.json?signature=' +``` + ## Code style The repo uses three tools, wired together via a pre-commit hook (`husky` + `lint-staged`): diff --git a/docs/quick-start.md b/docs/quick-start.md index 60b0dadf2..a7a8fd2b3 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -72,10 +72,13 @@ To log in, run: apify login ``` -You can then choose one of the following methods: +The CLI opens Apify Console in your browser, where you confirm the login. If the browser does not open, visit the printed URL and enter the code shown in your terminal. -- _(Recommended)_ Sign in through the Apify Console in your browser. -- Provide an [Apify API token](https://console.apify.com/settings/integrations). +To use an [Apify API token](https://console.apify.com/settings/integrations) instead, pass it directly: + +```bash +apify login --token +``` ### Push your Actor to Apify diff --git a/docs/reference.md b/docs/reference.md index c4591a868..cb330de5f 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -160,14 +160,19 @@ DESCRIPTION '~/.apify/auth.json'. All other commands use these stored credentials. - Run 'apify logout' to remove authentication. + By default, the login is confirmed in Apify Console in your browser by putting + in a code. Run 'apify logout' to remove authentication. USAGE - $ apify auth login [-m console|manual] [-t ] + $ apify auth login [-m oauth2|console|manual] [-t ] FLAGS - -m, --method=