1

I am developing a iOS application using nest apis, I am able to sign in to my nest account by presenting the nest web view and able to get all the smoke and thermostats associated with that account.

When I'm signing in with different account, I'm getting the devices which were added to the previous account, not the devices added to the current account.

These are my questions:

  1. How to sign out from current user account?
  2. How to get devices from multiple nest accounts?

https://github.com/nestlabs/iOS-NestDK

Here I am able to login for the first time, I have written the code to re login from another nest account (by presenting the nest web view) but I'm getting the structure of previous (which is first account's structure) after login with another nest account.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Ravi kumar J
  • 160
  • 8
  • 1
    we can not tell you what you do wrong, if we do not know what you are doing. show us your code! – hoijui Sep 09 '15 at 08:25
  • Do you mean sign in to the OAuth flow? Or are you looking for a way to invalidate a token? – urman Sep 09 '15 at 08:59
  • yes i need to invalidate token urman – Ravi kumar J Sep 09 '15 at 09:39
  • @hoijui , I have downloaded the sample code (iOS-NestDK) from github it is accepting one user ,i need to logout from that account and need to re login to another account – Ravi kumar J Sep 09 '15 at 09:42
  • give a link to the code and include the important parts directly in your question, make sure that all important info are in your questions, and that one does not have to also read the comments. do this by editing the question. – hoijui Sep 09 '15 at 14:12

1 Answers1

1

You can find the info on Deauthentication and invalidating tokens in our docs here: https://developer.nest.com/documentation/cloud/deauthorization-overview/

Make an HTTP DELETE call and replace <access_token> with the token you would like to invalidate. Here is an example in cURL.

curl -v -X DELETE 
"https://api.home.nest.com/oauth2/access_tokens/<access_token>"

That will remove your connection with that token as well as invalidate so any other service using it will no longer have access.

urman
  • 596
  • 2
  • 9