Obtain API Keys programmatically


#1

Hello,

I am one of the founders of http://www.getaegis.com We would like to add Rachio integration to our app.

Is there a way to login users using oauth2 to obtain api key programmatically?

Regards,

Nikko


#2

Of course there is, just not documented or officially supported. Https://app.rach.io is working after all.

Why deal with username/password though? Having your users provide an API key or sharing access with your account and using an API from that is much more secure / straight forward.


#3

Why deal with username/password though?

Using oauth2 standard, an app can obtain access token using authorize endpoint to connect without handling a username and password directly.

For example:

https://oauth.rach.io/oAuth/authorize?response_type=token&client_id=CLIENT_ID&redirect_uri=CALLBACK_URL&scope=read

The client ID would be an developer application ID that must be registered before hand. I could not find anything in the docs that mention this so i assume its not supported.

sharing access with your account and using an API

can you elaborate?


#4

@nikko If you email me at franz@rach.io I can get you all setup with OAuth2.

:cheers:


#5

I see that I was mistaken about oath, seems like a good way to go. As for one of my suggestions you could create an account with Rachio for your interface, something like api@getatgis.com and have your users share full access to their controller with that account. A single API key from that account (which you can get at will) would give you access to everyone who has shared their station/data.