<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Access google calendars of multiple google accounts (with user permission)]]></title><description><![CDATA[<p dir="auto">Hiya,</p>
<p dir="auto">We have a situation where we have users. Each user has 1 or more Google accounts. We want to be able to read events from a calendar using Google APIs.</p>
<p dir="auto">Is this something that FusionAuth can help with?</p>
]]></description><link>https://fusionauth.io/community/forum/topic/2659/access-google-calendars-of-multiple-google-accounts-with-user-permission</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 12:31:23 GMT</lastBuildDate><atom:link href="https://fusionauth.io/community/forum/topic/2659.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 Apr 2024 19:20:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Access google calendars of multiple google accounts (with user permission) on Tue, 30 Apr 2024 21:11:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://fusionauth.io/community/forum/uid/2986">@alex-3</a> I'm a bit unclear on what you are trying to do.</p>
<p dir="auto">Can you outline the exact steps you want to take?</p>
]]></description><link>https://fusionauth.io/community/forum/post/7212</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/7212</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Tue, 30 Apr 2024 21:11:55 GMT</pubDate></item><item><title><![CDATA[Reply to Access google calendars of multiple google accounts (with user permission) on Sun, 28 Apr 2024 23:37:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://fusionauth.io/community/forum/uid/20">@dan</a> Hi <a class="mention plugin-mentions-user plugin-mentions-a" href="https://fusionauth.io/community/forum/uid/20">@dan</a> . Thanks for your detailed guide. I have almost the same situation to solve.<br />
But I have related question - is it possible to not select a user to create a panding link? I don't want to have 'keep me signed in' checkbox. Instead, I would like to ask my backend to bind a link to the current user using the FusionAuth API.</p>
]]></description><link>https://fusionauth.io/community/forum/post/7207</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/7207</guid><dc:creator><![CDATA[alex 3]]></dc:creator><pubDate>Sun, 28 Apr 2024 23:37:05 GMT</pubDate></item><item><title><![CDATA[Reply to Access google calendars of multiple google accounts (with user permission) on Tue, 23 Apr 2024 19:50:07 GMT]]></title><description><![CDATA[<p dir="auto">Sure!</p>
<p dir="auto">This is a case of <a href="https://fusionauth.io/docs/lifecycle/authenticate-users/oauth/modes#third-party-service-authorization" rel="nofollow ugc">Third-Party Service Authorization</a> where your application is trying to access data on behalf of users held by another party (Google in this case).</p>
<p dir="auto">This will require some integration work on your part, but the basic steps are:</p>
<ul>
<li>Integrate your application with FusionAuth (<a href="https://fusionauth.io/docs/quickstarts/" rel="nofollow ugc">our quickstarts</a> are a good place to start). Make sure you check the 'keep me signed in' value set, using a hidden field.</li>
<li>Set up an Identity Provider. You don't want to use the Google Identity Provider because it doesn't support the <code>prompt</code> URL parameter.
<ul>
<li>Use the <a href="https://fusionauth.io/docs/lifecycle/authenticate-users/identity-providers/overview-oidc" rel="nofollow ugc">OIDC Identity Provider</a> with the <code>prompt</code> parameter set to <code>select_account</code> to let the users pick different accounts, and make sure you set <code>access_type</code> to <code>offline</code> to get a refresh token. <a href="https://fusionauth.io/docs/lifecycle/authenticate-users/identity-providers/social/google#custom-parameters" rel="nofollow ugc">More here</a>.</li>
<li>Set the <code>Linking strategy</code> to <code>Pending</code>.</li>
<li>You'll also need to set up your <a href="https://developers.google.com/identity/protocols/oauth2/scopes" rel="nofollow ugc">Google scopes</a> correctly. Based on your question, you'll want to use <code>https://www.googleapis.com/auth/calendar.events.readonly</code> as an additional scope.</li>
<li>You'll want to follow the <a href="https://fusionauth.io/docs/lifecycle/authenticate-users/identity-providers/social/google" rel="nofollow ugc">Google Identity Provider</a> instructions insofar as they pertain to navigating the Google Cloud Console.</li>
</ul>
</li>
<li>Create an 'connect your account with google' button in your application. This should point to the OIDC Identity Provider. You can use <a href="https://fusionauth.io/docs/lifecycle/authenticate-users/identity-providers/#hints" rel="nofollow ugc">an <code>idp_hint</code></a> to send the user directly to Google when they click it.</li>
<li>After they return from google, having selected their account, they should be logged in to your application. (It's possible with <code>Pending</code> they'll be prompted to login to your application again, but I don't think so. Would have to test.) They'll also have a link that is accessible via the <a href="https://fusionauth.io/docs/apis/identity-providers/links" rel="nofollow ugc">Link API</a>. That link will contain the refresh token in the <code>token</code> field.
<ul>
<li>You can also iterate all the links in your application using one of our <a href="https://fusionauth.io/docs/sdks/" rel="nofollow ugc">client libraries</a> to display to the user which google accounts they have connected.</li>
</ul>
</li>
</ul>
<p dir="auto">Now you have connected 1 or more Google accounts to a FusionAuth account.</p>
<p dir="auto">Next, when you want to retrieve calendar events for your application to process, take these steps:</p>
<ul>
<li>Call the Links API for the user to retrieve all the links</li>
<li>Retrieve the Google refresh token from the <code>token</code> field</li>
<li>Get a fresh access token using the <a href="https://developers.google.com/identity/protocols/oauth2/web-server#offline" rel="nofollow ugc">Refresh grant</a></li>
<li>Use the access token to retrieve the event data using either <a href="https://developers.google.com/calendar/api/v3/reference/events/get" rel="nofollow ugc">the API</a> or a <a href="https://developers.google.com/calendar/api/quickstart/js" rel="nofollow ugc">Google SDK</a>.</li>
<li>... profit!</li>
</ul>
<p dir="auto">If the <a href="https://developers.google.com/identity/protocols/oauth2#expiration" rel="nofollow ugc">refresh token has expired</a> (you don't get back a valid access token), inform the user and have them go through the authorization process again.</p>
<p dir="auto">Hope this helps.</p>
]]></description><link>https://fusionauth.io/community/forum/post/7200</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/7200</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Tue, 23 Apr 2024 19:50:07 GMT</pubDate></item></channel></rss>