Configure Device Authorization Grant Flow
This activity shows you how to initiate a device authorization grant flow to send an activation code to the end user. The authorization and flow orchestration steps apply only to applications that specify device_code as a grant type in the application configuration.
The following operations are supported by the PingOne APIs:
-
Create an application
-
Create a population and a user
-
Initiate an authorize request
-
Use flow APIs to complete the flow
Prerequisites
-
Get an access token from the worker application you created in Create an admin Worker app connection. If you prefer to get a token from a different worker application in an alternate sandbox environment, run the token request endpoint using the client ID and client secret of your chosen worker app to authenticate the request. Refer to Get a PingOne admin access token.
Workflow order of operations
To configure a device authorization grant flow using the environment’s default sign-on policy, the following tasks must be completed successfully:
-
Make a
POSTrequest to/environments/{{envID}}/applicationsto add a new application to the specified environment. -
Make a
POSTrequest to/environments/{{envID}}/populationsto create a new population resource. -
Make a
POSTrequest to/environments/{{envID}}/usersto create a user who will be assigned to the new population resource. -
Make a
PUTrequest to/environments/{{envID}}/users/{{userID}}/passwordto set the new user’s password. -
Make a
POSTrequest to/{{envID}}/as/device_authorizationto return the device code and the user code. -
Make a
GETrequest to/{{envID}}/deviceto initiate authorization and return a flow ID. -
Make a
GETrequest to/{{envID}}/flows/{{flowID}}to start the flow. -
To complete the login action, make a
POSTrequest to/{{envID}}/flows/{{flowID}}and provide the user’s login credentials. -
To complete the confirm activation code action, make a
POSTrequest to/{{envID}}/flows/{{flowID}}to submit the activation code. -
To complete the consent action, make a
POSTrequest to/{{envID}}/flows/{{flowID}}to accept the device authorization grant agreement. -
Make a
POSTrequest to/{{envID}}/as/tokento exchange the device code for an access token.
Click the Run in Postman button below to fork, or download and import, the Postman collection for this workflow to your workspace.