Difference between revisions of "Device flow usecase 1"

From i2Rest
Jump to: navigation, search
Line 3: Line 3:
 
Lets walk step by step through our example with creating "i2rest.doc" file on "i2restexample" user's Google Drive
 
Lets walk step by step through our example with creating "i2rest.doc" file on "i2restexample" user's Google Drive
  
'''Preparations'''<BR>
+
;Preparations
At the very begining your application should be registrated as a client (obtaining Device ID and Device Password) on the resource that will be requested for protected data. In our case we should follow   
+
:At the very begining your application should be registrated as a client (obtaining Device ID and Device Password) on the resource that will be requested for protected data. In our case we should follow   
 
[https://console.developers.google.com/apis/credentials Google's instructions].
 
[https://console.developers.google.com/apis/credentials Google's instructions].
  
step 1
+
;step 1
With Device ID and Device Password I2rest requests URI specified in «OAuth2 authorization endpoint» parameter. Authorization server responds with device code and Verification URI
+
:Execute command
       
+
 
If case of  *REQUESTER or *BOTH authorization srcreen will be displayed. In case of *NONE or *REMOTE no screen will be displayed, but requester or specified (Send authorization request to) User should get notification.
+
;step 2
+
:User Accept
That notification is handled by *DFT program, that gets Authorizer field with specified length as input parameter. 
 
       
 
Any program with custom logic (sms notification,  etc) can be applied.
 
During period of «Time to wait authorization» i2rest will poll «OAuth2 token endpoint» URI to get token, which should be issued after user authorizes request. Tokens obtained from the authorization sever will be saved to “Tokens storage”.
 

Revision as of 13:47, 6 April 2020

Google drive API

Lets walk step by step through our example with creating "i2rest.doc" file on "i2restexample" user's Google Drive

Preparations
At the very begining your application should be registrated as a client (obtaining Device ID and Device Password) on the resource that will be requested for protected data. In our case we should follow

Google's instructions.

step 1
Execute command
step 2
User Accept