Device Flow Usecase

From i2Rest
Revision as of 13:42, 6 April 2020 by Pavel.lobko (talk | contribs)
Jump to: navigation, search

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 With Device ID and Device Password I2rest requests URI specified in «OAuth2 authorization endpoint» parameter. Authorization server responds with device code and Verification URI

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.

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”.