SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff,
I am working on an SmartConnector integration with Google Calendar. The Update Processor prompts for google account authentication in SmartConnector debug mode and generates an OAuth2 Token Response file for future authentication use. The issue is when I deploy my Update processor, it no longer prompt for Google credentials authentication from Smartconnector portal site.
If I use the credential file created in debug mode, Update Processor reads the google calendar from portal site. So, only issue seems is opening a browser window for authentication permission from SmartConnector portal. Any restrictions from SmartConnector portal ? I wonder if you have worked with Google Calendar… Any thoughts ?
Thanks!
Neeraj Tomar
Link copied. Please paste this link to share this article on your social media post.
Hi Neeraj,
Looks like we may have done the same extension, I also built a Google Calendar integration a while back. I ran into the same issue, there are different ways to tackle the auth but if you want to stick with the mode you have (which appears to be the same things as I did) then you could also write a short console app to deploy with your extension. I do this, it's documented as part of my install notes to run that first. It runs outside of the SmartConnector process once on setup and downloads and stores the OAuth token. The SmartConnector extension uses the downloaded credentials to make the requests thereafter.
I'm not sure if it's supported (or if it would work) but there's always a chance SmartConnector could start that console app out of the SC process in another thread. You could look at support for running Process.Start()
Just a thought.. you may have already done this but if not, it's a perfectly reasonable work around since you don't need this part to run after setup.
Adam.
Link copied. Please paste this link to share this article on your social media post.
Hi Neeraj,
What do you mean by prompt? Do you mean something pops up on your computer when you run it?
This may work in debug mode, since your Visual Studio is running as your personal user, the issue is the Smart Connector service runs as the System user. So this may be the problem. Personally I wouldn’t want to rely on this, and perhaps you can do it programmatically where a Smart Connector configuration setting asks for these credentials, and you use those somehow to automatically generate the credential file.
Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Neeraj,
Looks like we may have done the same extension, I also built a Google Calendar integration a while back. I ran into the same issue, there are different ways to tackle the auth but if you want to stick with the mode you have (which appears to be the same things as I did) then you could also write a short console app to deploy with your extension. I do this, it's documented as part of my install notes to run that first. It runs outside of the SmartConnector process once on setup and downloads and stores the OAuth token. The SmartConnector extension uses the downloaded credentials to make the requests thereafter.
I'm not sure if it's supported (or if it would work) but there's always a chance SmartConnector could start that console app out of the SC process in another thread. You could look at support for running Process.Start()
Just a thought.. you may have already done this but if not, it's a perfectly reasonable work around since you don't need this part to run after setup.
Adam.
Link copied. Please paste this link to share this article on your social media post.
Thanks Adam. I have similar thoughts to have a separate application to get the authentication response – token file for use by smartconnector. I discussed with Jeff and he explained since SmartConnector is running as a service, it’s not possible to run an executable from it.
"there are different ways to tackle the auth" -- did you try some other methods too...
Link copied. Please paste this link to share this article on your social media post.
No I haven't tried any other methods for the Calendar API, I'm not sure if calendar supports anything other than OAuth, other google services support different auth methods which you could code into the extension processor. I just left my implementation with OAuth right now.
I guess it needs a bit more digging into the API docs to see if there is anything else which could be done. - It's been a few months since I was on that extension..
Link copied. Please paste this link to share this article on your social media post.
No problem. OAuth seems right way to do it. Thanks!
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.