openT2T / opent2t-cli

Command Line Interface (CLI) for Open Translators to Things.
http://www.opentranslatorstothings.org
Other
3 stars 6 forks source link

Adding RefreshToken support to opent2t-cli for testing RefreshAuthToken() workflow #12

Closed shalinijoshi19 closed 7 years ago

shalinijoshi19 commented 7 years ago
  1. At this point, this will work only for WINK hubs; Unexpected behavior when run against any other translator/hub.
  2. Overwriting the original onboarding file with the new information retrieved.
  3. In the CLI it made sense to add the client calls to the onboardingcli.js though the actual implementation on the server are in teh hub translator (not onboarding module).
  4. There is dup code in onboardingcli.js that I am hoping to get rid of (but had caused a break at this point when I was trying to clean it up)

Output (Note: You need corresponding hub changes that implement refreshAuthToken() from PR: https://github.com/openT2T/translators/pull/126)

C:\opent2t\sj\opent2t-cli>node index.js -r opent2t-translator-com-wink-hub Open Translators to Things CLI:

------ Refreshing oAuth token for hub "opent2t-translator-com-wink-hub" ----------------------------- Package Info undefined

--------------- "getDeveloperInput" ? Ask for Client id ? Ask for Client Secret Getting refreshAuthToken from opent2t-translator-com-wink-hub { "accessToken": "tM_pqH6Wm0-zA5Fbl5MyM5LRdV4A6z6q", "refreshToken": "T_i4HlCb6AkrYYwz324GO9WwgiMxRajV", "tokenType": "bearer", "scopes": "full_access" } ------ Saving refreshed onboardingInfo to: ./opent2t-translator-com-wink-hub_onboardingInfo.json Saved!

msftclas commented 7 years ago

Hi @shalinijoshi19, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

It looks like you're a Microsoft contributor (Shalini Joshi). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

arjun-msft commented 7 years ago

:shipit: