<?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[Upcoming Google Identity Provider changes]]></title><description><![CDATA[<p dir="auto"><strong>Edit:</strong> This post was updated on 2023/03/13 to reflect FusionAuth's decision to use Google's HTML API.<br />
<strong>Edit:</strong> This post was updated on 2024/01/10 to reflect resolution to <a href="https://github.com/FusionAuth/fusionauth-issues/issues/2186" rel="nofollow ugc">GitHub Issue 2186</a>.</p>
<p dir="auto">tl;dr</p>
<p dir="auto">Google is retiring its Google Sign-In JavaScript Platform Library on March 31, 2023. FusionAuth instances using the Google Identity Provider with the “Use popup for login” login method require configuration changes or an upgrade prior to this date.</p>
<p dir="auto">/tl;dr</p>
<p dir="auto">Hi folks,</p>
<p dir="auto">Google is retiring its Google Sign-In JavaScript Platform Library on March 31, 2023. FusionAuth versions 1.43.0 and earlier use this library to provide support for “Login with Google” in a popup window. FusionAuth is required to update to the new Google Identity Services library as a result of the platform library being retired.</p>
<p dir="auto">We’ve known about this for a while and are sorry we haven’t fixed this sooner. Other projects took a bit longer than we thought. The good news is that there’s a quick workaround that has minimal impact on your users that you can use as long as you have version 1.28 or greater of FusionAuth. This is option 1 mentioned below.</p>
<p dir="auto">If any of the following apply to you, then you are <strong>not</strong> impacted by this and no changes are required for your FusionAuth instance:</p>
<ol>
<li>You are not using the Google Identity Provider</li>
<li>You are not using FusionAuth’s hosted login pages</li>
<li>You are using the Google Identity Provider with the <em>Use redirect for login</em> login method</li>
</ol>
<p dir="auto">If all of the following are true, then you must take action prior to the March 31, 2023 deadline:</p>
<ol>
<li>You are using FusionAuth’s hosted login pages</li>
<li>You are using FusionAuth’s Google Identity Provider on these hosted login pages</li>
<li>Your Google Identity Provider is configured with the <em>Use popup for login</em> login method</li>
</ol>
<p dir="auto">There are two options to continue using the Google Identity Provider after this date:</p>
<ol>
<li>Change your Google Identity Provider configuration to the <em>Use redirect for login</em> login method</li>
<li>Upgrade FusionAuth to version 1.44.0 or later</li>
</ol>
<h3>Important note</h3>
<p dir="auto">If you do not make these changes, your users will no longer be able to log in using Google after March 31, 2023. Other users logging in using passwords or other login methods will be unaffected.</p>
<h2>Option 1:</h2>
<p dir="auto">Update your Google Identity Provider configuration at <strong>Settings &gt; Identity Providers &gt; Edit Google</strong>. Change the “Login method” to <em>Use redirect for login</em> and save the configuration.</p>
<p dir="auto"><img src="/community/forum/assets/uploads/files/1677521165144-screenshot-2023-02-27-at-12.05.36-pm.png" alt="Screenshot 2023-02-27 at 12.05.36 PM.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">This provides the same login functionality as <em>Use popup for login</em>. The only difference is the user experience. When a user clicks the “Login with Google” button with <em>Use redirect for login</em>, the current browser window will be redirected to the Google login page rather than opening a popup window for the user to sign in.</p>
<h2>Option 2:</h2>
<p dir="auto">Version 1.44.0 of FusionAuth updates the Google Identity Provider implementation to use the new Google Identity Services JavaScript library and removes the dependency on the retired Google Sign-In JavaScript Platform Library.</p>
<p dir="auto">In order to continue using the Google Identity Provider on FusionAuth hosted login pages with the <em>Use popup for login</em> login method, you will need to upgrade your FusionAuth instance to 1.44.0 or later.</p>
<p dir="auto">If your hosted login pages have been modified with a custom theme, you will also need to update the templates of your theme to:</p>
<ol>
<li>Replace the old <code>&lt;script&gt;</code> tag for the Google library include with the new one</li>
<li>Add new <code>&lt;div&gt;</code> elements that will be used to initialize the new Google Identity Services API and place the new “Sign in with Google” button</li>
<li>Update templates to pass along IdP state</li>
</ol>
<p dir="auto">See the section below for more details on the required template updates. You can also reference the default theme that ships with FusionAuth for guidance on making these updates to your templates.</p>
<h3>Template updates</h3>
<h4>Replace <code>&lt;script&gt;</code> includes</h4>
<p dir="auto">Find the following block with <code>&lt;script&gt;</code> tags in your templates. By default you can find it in the “Helpers” template for your theme inside the <code>alternativeLoginsScript</code> macro.</p>
<pre><code>[#if identityProviders["Google"]?has_content]
  &lt;script src="https://apis.google.com/js/api:client.js"&gt;&lt;/script&gt;
  &lt;script src="${request.contextPath}/js/identityProvider/Google.js?version=${version}" data-client-id="${identityProviders["Google"][0].lookupClientId(clientId)}"&gt;&lt;/script&gt;
[/#if]
</code></pre>
<p dir="auto">Replace it with the following block:</p>
<pre><code>[#if identityProviders["Google"]?has_content &amp;&amp; identityProviders["Google"][0].lookupLoginMethod(clientId) != "UseRedirect"]
  &lt;script src="https://accounts.google.com/gsi/client" async defer&gt;&lt;/script&gt;
  &lt;script src="${request.contextPath}/js/identityProvider/Google.js?version=${version}" data-client-id="${identityProviders["Google"][0].lookupClientId(clientId)}"&gt;&lt;/script&gt;
[/#if]
</code></pre>
<p dir="auto">The updated script includes do a couple of things:</p>
<ol>
<li>The scripts are not loaded if the Google IdP login method is configured to <em>Use redirect for login</em> as the redirect login method does not use the JavaScript libraries</li>
<li>It loads the new Google Identity Services JavaScript API</li>
</ol>
<h4>Add <code>&lt;div&gt;</code> elements for API initialization and button</h4>
<p dir="auto">The new Google Identity Services can be accessed with an HTML API. A <code>div</code> element with an <code>id</code> attribute of <code>"g_id_onload"</code> will be selected by the included script, and <code>data-</code> attributes on the <code>div</code> will customize the API initialization.</p>
<p dir="auto">A “Sign in with Google” button is added to an empty <code>&lt;div&gt;</code> with the <code>g_id_signin</code> class.</p>
<p dir="auto">If your templates still use the <code>googleButton</code> macro in the “Helpers” template, you should make the changes in that macro. We recommend replacing the existing <code>googleButton</code> macro with the following:</p>
<pre><code>[#macro googleButton identityProvider clientId idpRedirectState=""]
  [#-- When using this loginMethod - the Google JavaScript API is not used at all. --]
  [#if identityProvider.lookupLoginMethod(clientId) == "UseRedirect"]
    &lt;button id="google-login-button" class="google login-button" data-login-method="UseRedirect" data-scope="${identityProvider.lookupScope(clientId)!''}" data-identity-provider-id="${identityProvider.id}"&gt;
      &lt;div&gt;
       &lt;div class="icon"&gt;
         &lt;svg version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"&gt;
           &lt;g&gt;
             &lt;path class="cls-1" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"&gt;&lt;/path&gt;
             &lt;path class="cls-2" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"&gt;&lt;/path&gt;
             &lt;path class="cls-3" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"&gt;&lt;/path&gt;
             &lt;path class="cls-4" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"&gt;&lt;/path&gt;
             &lt;path class="cls-5" d="M0 0h48v48H0z"&gt;&lt;/path&gt;
           &lt;/g&gt;
         &lt;/svg&gt;
       &lt;/div&gt;
       &lt;div class="text"&gt;${identityProvider.lookupButtonText(clientId)?trim}&lt;/div&gt;
      &lt;/div&gt;
    &lt;/button&gt;
  [#else] [#-- UsePopup or UseVendorJavaScript --]
    [#--
     Use the Google Identity Service (GIS) API.
     https://developers.google.com/identity/gsi/web/reference/html-reference
    --]
    &lt;div id="g_id_onload" [#list identityProvider.lookupAPIProperties(clientId)!{} as attribute, value] data-${attribute}="${value}" [/#list]
         data-client_id="${identityProvider.lookupClientId(clientId)}"
         data-login_uri="${currentBaseURL}/oauth2/callback?state=${idpRedirectState}&amp;identityProviderId=${identityProvider.id}" &gt;
    &lt;/div&gt;
    [#-- This the Google Signin button. If only using One tap, you can delete or commment out this element --]
    &lt;div class="g_id_signin" [#list identityProvider.lookupButtonProperties(clientId)!{} as attribute, value] data-${attribute}="${value}" [/#list]
         [#-- Optional click handler, when using ux_mode=popup. --]
         data-click_listener="googleButtonClickHandler" &gt;
    &lt;/div&gt;
  [/#if]
[/#macro]
</code></pre>
<p dir="auto">The if/else will render the existing button for <em>Use redirect for login</em> or render the <code>div</code>s that will be used to initialize the new Google Identity Services API and render the login button. The <code>&lt;button&gt;</code> element remains unchanged from the previous version of the template.</p>
<h4>Update templates to pass along IdP state</h4>
<p dir="auto">The updated <code>googleButton</code> macro contains a new <code>idpRedirectState</code> parameter. This is required to pass along state for a user that is redirected back to FusionAuth after authenticating with Google. This value is set by FusionAuth and can be used in templates to pass along the required state.</p>
<p dir="auto">The following templates need to be updated to pass along this state:</p>
<ol>
<li>The "Helpers" template <code>googleButton</code> macro needs to be updated to add this parameter (handled above)</li>
<li>The "Helpers" template <code>alternativeLogins</code> macro needs to be updated to add this parameter and pass along to the <code>googleButton</code> macro invocation</li>
<li>The "OAuth authorize" template's <code>alternativeLogins</code> macro invocation needs to provide this parameter</li>
<li>The "OAuth register" template's <code>alternativeLogins</code> macro invocation needs to provide this parameter</li>
</ol>
<p dir="auto"> </p>
<p dir="auto"><strong><code>googleButton</code> macro parameter</strong></p>
<p dir="auto">The <code>googleButton</code> macro is declared in the "Helpers" template of the theme. The recommended <code>googleButton</code> macro updates in the previous section include adding the <code>idpRedirectState</code> parameter to the macro declaration with a default value of an empty string:</p>
<pre><code>[#macro googleButton identityProvider clientId idpRedirectState=""]
</code></pre>
<p dir="auto"><strong><code>alternativeLogins</code> macro parameter</strong></p>
<p dir="auto">The <code>alternativeLogins</code> macro is declared in the "Helpers" template. Add the <code>idpRedirectState</code> to the macro declaration and pass along to the <code>googleButton</code> macro invocation.</p>
<pre><code>[#macro alternativeLogins clientId identityProviders passwordlessEnabled bootstrapWebauthnEnabled=false idpRedirectState=""]
  ...
  [#if identityProviders["Google"]?has_content]
    &lt;div class="form-row push-less-top"&gt;
      [@googleButton identityProvider=identityProviders["Google"][0] clientId=clientId idpRedirectState=idpRedirectState/]
    &lt;/div&gt;
  [/#if]
  ...
[/#macro]
</code></pre>
<p dir="auto"><strong>OAuth authorize <code>alternativeLogins</code> invocation</strong></p>
<p dir="auto">The "OAuth authorize" template invokes the <code>alternativeLogins</code> macro to display IdP and other login options. The call to <code>@helpers.alternativeLogins</code> needs to pass along the <code>idpRedirectState</code> parameter from the page.</p>
<pre><code>[@helpers.alternativeLogins clientId=client_id identityProviders=identityProviders passwordlessEnabled=passwordlessEnabled bootstrapWebauthnEnabled=bootstrapWebauthnEnabled idpRedirectState=idpRedirectState/]
</code></pre>
<p dir="auto"><strong>OAuth register <code>alternativeLogins</code> invocation</strong></p>
<p dir="auto">The "OAuth register" template invokes the <code>alternativeLogins</code> macro to display IdP and other login options. The call to <code>@helpers.alternativeLogins</code> needs to pass along the <code>idpRedirectState</code> parameter from the page.</p>
<pre><code>[@helpers.alternativeLogins clientId=client_id identityProviders=identityProviders![] passwordlessEnabled=false bootstrapWebauthnEnabled=false idpRedirectState=idpRedirectState/]
</code></pre>
<p dir="auto"> <br />
If you have any questions or concerns, please let us know either by <a href="https://fusionauth.io/contact/" rel="nofollow ugc">contacting us</a> or posting below.</p>
]]></description><link>https://fusionauth.io/community/forum/topic/2329/upcoming-google-identity-provider-changes</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 23:40:02 GMT</lastBuildDate><atom:link href="https://fusionauth.io/community/forum/topic/2329.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Feb 2023 18:07:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Upcoming Google Identity Provider changes on Wed, 10 May 2023 09:48:03 GMT]]></title><description><![CDATA[<p dir="auto">The latest templates use <code>lookupLoginMethod(clientId)</code> and not just <code>loginMethod</code>.</p>
]]></description><link>https://fusionauth.io/community/forum/post/6131</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/6131</guid><dc:creator><![CDATA[glen]]></dc:creator><pubDate>Wed, 10 May 2023 09:48:03 GMT</pubDate></item><item><title><![CDATA[Reply to Upcoming Google Identity Provider changes on Tue, 28 Feb 2023 14:55:08 GMT]]></title><description><![CDATA[<p dir="auto">That's right <a class="mention plugin-mentions-user plugin-mentions-a" href="https://fusionauth.io/community/forum/uid/1304">@damien</a>. Thank you for pointing that out. I should have mentioned it in the initial post.</p>
<p dir="auto">Version 1.44.0 of FusionAuth has not been released yet, but we wanted to post about the upcoming changes and the workaround that has been identified to give developers more time to plan changes.</p>
<p dir="auto">My apologies for any confusion. The new release is coming soon.</p>
]]></description><link>https://fusionauth.io/community/forum/post/5984</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/5984</guid><dc:creator><![CDATA[spencer]]></dc:creator><pubDate>Tue, 28 Feb 2023 14:55:08 GMT</pubDate></item><item><title><![CDATA[Reply to Upcoming Google Identity Provider changes on Tue, 28 Feb 2023 11:37:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://fusionauth.io/community/forum/uid/1846">@spencer</a> this post talks about upgrading to 1.44.0 or later, but 1.44.0 is not actually released yet? Right?</p>
]]></description><link>https://fusionauth.io/community/forum/post/5983</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/5983</guid><dc:creator><![CDATA[damien]]></dc:creator><pubDate>Tue, 28 Feb 2023 11:37:41 GMT</pubDate></item></channel></rss>