Announcement
Collapse
No announcement yet.
Credentials procedure on linux headless
Collapse
X
-
Guest repliedThanks !! Will try it tomorow . Now, time to sleep(canada/Montreal).
Leave a comment:
-
oauthplayground didn't work for me.
So I created a little app authenticator.exe (attached) which you can run anywhere (after obtaining ClientID and ClientSecret):
Note: I also recommend to use this app for testing your Mono version before you actually try to use the plugin. It makes it easier to troubleshoot Google Calendar API .NET dependencies.
Code:authenticator.exe [I]ClientID ClientSecret[/I]
Code:********************************************* Credential file saved to: D:\My\Temp\Release\token.json D:\My\Temp\Release\token.json\Google.Apis.Auth.OAuth2.Responses.TokenResponse-user ********************************************* pp08kp35e77ap05mmm94a00gmk@group.calendar.google.com HS-Heat #f691b2 i04d1nir7395dmril3dvpstijg@group.calendar.google.com HS-Gates #16a765 jgcuopiksi78f231qq5t23b2pg@group.calendar.google.com Homeseer #fbe983 95dfa41185hao6gmvpss2nelro@group.calendar.google.com HS-TV #ffad46
Alternatively you can copy the file manually to "HomeSeer HS3\Bin\AKGoogleCalendar\token.json" folder (may need to create "token.json" folder first)
Then click "Submit" button to apply the credentials (you still need the ClientID and ClientSecret fields).
- Likes 1
Leave a comment:
-
Another option is to use https://developers.google.com/oauthplayground/ to obtain the response token. I will test and add to my documentation.
- Likes 1
Leave a comment:
-
Originally posted by Simplex Technology View PostYou can use the HS myhs + your plugin as the callback URL. Then you can read the response directly via your plugin.
The problem is when your HS installation is headless, so you can't see the "User login & consent" which Google API pops-up and you can't click "Approve".
Another option is to temporary run the plugin remotely on normal computer (preferably Windows) and then copy the received Google.Apis.Auth.OAuth2.Responses.TokenResponse-user file to HS machine. But then it's probably easier if I just create a separate little app to perform the authorization?
What a pain...
- Likes 1
Leave a comment:
-
Guest repliedI will try this tomorrow or Friday . Thank alexbk66
But what , said will simplify the procedure. I think phlocation does..exactly that!
Leave a comment:
-
You can use the HS myhs + your plugin as the callback URL. Then you can read the response directly via your plugin.
- Likes 1
Leave a comment:
-
As I said Google designed their OAuth2 authorization for web based apps, not console apps because when you request the authorization the app should provide a callback url where Google sends the response file. For Windows based console apps their API has built-in webserver which listens for this callback. On Linux this may not work. However I tested on my Raspberry installation and it did work, but you need to have a web browser and login with your Gmail account. Here's how Google describe the process:
Some requests require an authentication step where the user logs in with their Google account. After logging in, the user is asked whether they are willing to grant the permissions that your application is requesting. This process is called user consent.
If the user grants the permission, the Google Authorization Server sends your application an access token (or an authorization code that your application can use to obtain an access token)
1. Basically you have to obtain OAuth2 response file using another computer (preferably Windows). I mean you need to do the authorisation procedure and Google API will save a file called Google.Apis.Auth.OAuth2.Responses.TokenResponse-user locally in folder token.json (yes, it's a folder, not file).
2. Then on AKGoogleCalendar config page you can use "Upload Credentials" button to copy Google.Apis.Auth.OAuth2.Responses.TokenResponse-user file to the plugin bin folder. Alternatively you can copy the file manually to "HomeSeer HS3\Bin\AKGoogleCalendar\token.json" folder (may need to create "token.json" folder first).
3. Once you have the response file in the correct location - you need to enter your Client ID and Client Secret in AKGoogleCalendar config page and click Submit. Since it's got the OAuth2 response already - it should just work.
Main question how to do #1? I did it using another Windows HS installation. Otherwise I might need to create a simple app which you can run elsewhere and receive the Google.Apis.Auth.OAuth2.Responses.TokenResponse-user file.
Leave a comment:
-
Credentials procedure on linux headless
Could you explain a step by step for this ?
thanksTags: None
Leave a comment: