I have a .NET page which users can log into through various methods, including Google, Facebook, Twitter, and by creating a username and password directly on the site. I have a page that only logged-in users can see that has a calendar embedded.
Right now this calendar is not public, and can only be seen by Google users I authorize. I could of course make it public, but then once anyone knows the url of the calendar alone they could just go there and see it. I could also share it with anyone who's registered to my website through Google, but then it wouldn't be visible to people logged in through Facebook or some other way.
Question: How can I programmatically receive the calendar and display it to anyone who's logged into my website any way without having to make it public?
The two approaches that make sense to me are:
Below is the page with a standard embed for the calendar as an example.
@{
ViewBag.Title = "Calendar";
}
<h2>Calendar</h2>
<iframe src="https://calendar.google.com/calendar/embed?src=sharing.thelangschool.org_hrq83e34uldebnrcd4hptop0ps%40group.calendar.google.com&ctz=America/New_York" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
You should use a service account https://developers.google.com/identity/protocols/OAuth2ServiceAccount and share your calendar with this service account's email address. Then your app can use the service account's credentials to display the events.