photon account oauth.
Clients
--redirect-uri and --scope are repeatable; without --scope the client has
no delegated scopes. The default redirect must exactly match one of the
supplied redirect URIs. Redirect URIs must use HTTPS, except for HTTP loopback
URLs during development. User info, fragments, duplicates, and more than ten
redirect URIs are rejected before the request is sent.
Creation sends an idempotency key, generated unless you pass
--idempotency-key. If the outcome is uncertain — the connection dropped or
Photon answered with a server error — the error names the key: retry the same
command with it rather than a new one, and Photon returns the client the first
request created.
update replaces redirect URIs or scopes when you supply them. Use
--clear-description or --clear-scopes to remove those values:
delete reports status. When Photon has accepted the deletion but provider
cleanup is still pending, the CLI warns that existing tokens may keep working
until it completes.
Test an authorization
authorize builds an authorization-code request and opens it, which is the
fastest way to check a client’s redirect URIs and scopes:
This helper only generates the authorization URL, state, and nonce. Your
registered application handles the callback and exchanges the code with its
own client secret — the CLI never accepts or stores that secret.
Secrets
An OAuth client has one secret. Rotating it replaces it with a new one, and the replaced secret keeps working for one hour so your application can switch over.secret viewreturns metadata only: the current secret’s hint, creation time and last use, and the replaced secret withvalidUntilwhile it still works.secret createsets up the client’s first secret. If the client already has one, it fails withOAUTH_SECRET_CONFIGURED; replace it withsecret rotate.secret rotatemints a new secret. The replaced secret works untilpreviousSecretValidUntil, one hour from now; with--emergencyit stops now andpreviousSecretValidUntilisnull. A client with no secret fails withOAUTH_SECRET_NOT_CONFIGURED; set one up withsecret create.secret revokestops the secret now, and a replaced secret still in its hour stops with it.
JSON output
With--json, each command prints the API’s response as Photon sends it, with
every field in it, including a field the API adds after this CLI release:
update reads the client for its ETag before it changes it, and prints the
response to the change.
Two commands print a document the CLI defines instead. authorize builds the
authorization request itself, with a state and nonce of its own, and
secret revoke gets no body from Photon, so it names what it revoked:
These commands replaced
photon account oauth client and
photon account oauth secret, which now only point here. secret list
became secret view, since a client has one secret.