php - Authenticate single user in Google Calendar api -
i'm working on system allows schedule events using google's calendar api. however, going small company's internal use , need use single google account (ie 1 entire company) can have access exact same events.
i've implemented calendar api , scheduling functionality (in php btw), when authenticating user able login google account, including personal ones. should able authenticate company account events don't scheduled personal accounts.
what thought doing checking authenticated account's email address see if matches company one, , if doesn't error displayed telling them on wrong account.
this work, seems inefficient , ugly solution (especially considering i'd need use google+ api email address).
what recommended way of doing this?
(also, calendar api documentation sucks. what's that!)
if authenticating using google's oauth2 mechanism, must register app in google api console (https://code.google.com/apis/console), , provide client secret, client id, authorization uri, , forth app. under authentication mechanism, users have no choice authenticate account registered in api console, , hence there no problem them authenticating "other" accounts.
google's advice on using alternate (non oauth) authentication means follows:
authsub , clientlogin google's proprietary authorization apis, available alternative oauth google apis. if possible, should avoid using these services. if have applications use them, should migrate recommended options described above.
https://developers.google.com/gdata/docs/auth/overview
additionally, "clientlogin" & "authsub" have been deprecated:
important: clientlogin has been officially deprecated of april 20, 2012. continue work per our deprecation policy, encourage migrate oauth 2.0 possible.
https://developers.google.com/accounts/docs/authforinstalledapps
important: authsub has been officially deprecated of april 20, 2012. continue work per our deprecation policy, encourage migrate oauth 2.0 possible.
https://developers.google.com/accounts/docs/authsub
my advice migrate oauth2, , problem solves itself. if using 1 of 2 deprecated methods, may have formulate own "very inefficient , ugly solution", said.
and google calendar docs pretty extensive: https://developers.google.com/google-apps/calendar/
are easy? no. 1 thing aren't scarce. php client library here:
https://code.google.com/p/google-api-php-client/
with php sample here:
https://code.google.com/p/google-api-php-client/source/browse/trunk/examples/calendar/simple.php
be aware of google docs calendar assume use of oauth2.
Comments
Post a Comment