State
-
Not doing anything yet, did not even check for previous credentials. The user code is expected to begin the flow via
start()
. -
The flow has been started and no valid access or refresh tokens were found in the storage. No “silent” mode was requested so the client is waiting for the user code to show a browser and navigate to the given URL where the end-user is going to authenticate themselves and authorize the client to access the resource in question.
The user code is also responsible for intercepting requests to a redirect URL and passing them back to us via
handleAuthorizationFailure()
.Note that we are not using
URLRequest
here as it would be hard to support one with an external browser. -
The client is exchanging the authorization code received from the server for an access token.
-
The flow has failed at some point, no credentials are available. The user code might restart the process.
-
The flow has been explicitly cancelled by the user. Separate from
.failed
to never display “cancelled” errors. -
The client got authorization to access the requested scopes. The corresponding tokens are available (
credentials
) though they might be (almost) expired and the client can be in the process of refreshing them. When this happens the user code should wait before using the credentials.