<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Manage GCP Group with Qlik Automation in Member Articles</title>
    <link>https://community.qlik.com/t5/Member-Articles/Manage-GCP-Group-with-Qlik-Automation/ta-p/2050705</link>
    <description>&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;By the time I’m writing this article Qlik Cloud Service does not support yet the GCP user group during the authentication phase. Thus allow GCP users to access Qlik Cloud, base on their groups is not (yet) an option.&lt;/P&gt;
&lt;P&gt;This is expected to be a temporary situation and Qlik will deliver soon (or later) also this feature. Nevertheless timing is important and it may avoid the SaaS adoption for Qlik enthusiast with the hard constraint to relay on Google groups.&lt;/P&gt;
&lt;P&gt;In the context above, in this article I'm going to propose an alternative way to achieve the same business scope &lt;SPAN&gt;granting users to spaces based on their membership groups. Therefore, acting on the Authorization instead, the Authentication. This solution is imperfect, widely improvable (anyone is welcome to contribute) and to some extent graceless, but it just works and sometime could make the difference between adopting Qlik SaaS or something else.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;Qlik Cloud Service&lt;/LI&gt;
&lt;LI&gt;Qlik Application Automation&lt;/LI&gt;
&lt;LI&gt;GCP Directory API&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Resolution&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Any authenticated user (through GCP or any other solution) will land on Qlik Cloud creating a new user for their first access. This solution is triggered on that specific event “User Creation”. &lt;LI-PRODUCT title="Qlik Application Automation" id="qlikApplicationAutomation"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp; is triggered on the User creation event, and go through the following steps&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Invoke the Google Directory API and retrieve the list of authorized users.&lt;/LI&gt;
&lt;LI&gt;Check the new created user is among this list.&lt;/LI&gt;
&lt;LI&gt;If the user is authorized to access, then assign a license and grants for the authorized spaces.&lt;/LI&gt;
&lt;LI&gt;If the user is not authorized, then the automation disables it.&lt;/LI&gt;
&lt;/UL&gt;
&lt;H4&gt;Google API Call&lt;/H4&gt;
&lt;P&gt;Here you can find the Google API &lt;A title="Google Developer Documentation" href="https://developers.google.com/admin-sdk/directory/reference/rest/v1/members/list?hl=en" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt; . The HTTP request retrieve a paginated list of users belonging to the same {groupKey}. This HTTP request needs an authentication&amp;nbsp;method, for this you need to &lt;A title="Google developers documentation" href="https://developers.google.com/identity/protocols/oauth2/service-account#creatinganaccount" target="_blank" rel="noopener"&gt;create a service account&lt;/A&gt; on the google platform.&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Follow the instruction &lt;A href="https://developers.google.com/identity/protocols/oauth2/service-account#python" target="_self"&gt;here&lt;/A&gt; to get the user account, the private key and the private key id.&lt;/LI&gt;
&lt;LI&gt;Set the start Block as:
&lt;UL&gt;
&lt;LI&gt;Run Mode : Webhook&lt;/LI&gt;
&lt;LI&gt;Connector : Qlik Cloud Service&lt;/LI&gt;
&lt;LI&gt;Event : User Created&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;From the Qlik Cloud Service Connector use the Get User Block to get the user details from the user just created&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_0-1679567200500.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103342i2882BFF852DE28E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_0-1679567200500.png" alt="Vincenzo_Esposito_0-1679567200500.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Next step is getting the Bearer Token for the REST call. Use two variable blokes to store the Private Key and&amp;nbsp;the Private Key Id.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vincenzo_Esposito_1-1679567241223.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103343i82E79FA68265BC52/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_1-1679567241223.png" alt="Vincenzo_Esposito_1-1679567241223.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Pay attention to paste the Private Key. It is made of 3 lines. The first line is the “BEGIN PRIVATE KEY” the second line is the key itself &lt;STRONG&gt;without any carriage return line feed&lt;/STRONG&gt;, the third line is the “END PRIVATE KEY” line. You should end up with something like this:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;-----BEGIN PRIVATE KEY-----&lt;/EM&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;&amp;lt;Your private Key in one single line, remove all the CR+LF or /n&amp;gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;-----END PRIVATE KEY-----&lt;/EM&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="lia-align-left"&gt;Use a custom code block to get the Bearer token. You need to pass 3 inputs to the custom block&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_2-1679567325440.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103344i44AF7586514F2854/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_2-1679567325440.png" alt="Vincenzo_Esposito_2-1679567325440.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Private Key id from the variable&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Private Key from the variable&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Time as: {number: {date: 'now', 'U'}}&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Select Python as language and paste these lines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import jwt

iat = inputs['time'] 
exp = iat + 3600 * 1000
payload = {'iss': 'qlik-user-sync@qliksaasidp-377811.iam.gserviceaccount.com',
           'sub': 'qlik-user-sync@qliksaasidp-377811.iam.gserviceaccount.com',
           'aud': 'https://admin.googleapis.com/',
           'iat': iat,
           'exp': exp}
additional_headers = {'kid': inputs['Private Key Id'],"alg": "RS256","typ": "JWT"}

signed_jwt = jwt.encode(payload, inputs['Private Key'], headers=additional_headers,
                       algorithm='RS256')
print (signed_jwt)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;For more details please check &lt;A href="https://developers.google.com/identity/protocols/oauth2/service-account#python" target="_blank" rel="noopener"&gt;this&lt;/A&gt; page.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Next steps need to manage the multipage. Use a new variable, call it pageToken and set as empty string.&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_0-1679567604814.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103345iDFE76B0429EC73AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_0-1679567604814.png" alt="Vincenzo_Esposito_0-1679567604814.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;The following 3 steps get the number of users the query will retrieve and create an array with the number of pages to read.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_1-1679567682445.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103346iF1AE0D7353E8AA3D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_1-1679567682445.png" alt="Vincenzo_Esposito_1-1679567682445.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Inside the Loop, as first step let’s call the Google Directory API. Use the Call URL Block. You can find the documentation on how to use it at &lt;A href="https://developers.google.com/admin-sdk/directory/reference/rest/v1/members/list?hl=en" target="_blank" rel="noopener"&gt;this&lt;/A&gt; page.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_2-1679567717160.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103347i4EB332DC88D05069/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_2-1679567717160.png" alt="Vincenzo_Esposito_2-1679567717160.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Remember to use as parameter the pageToken&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_3-1679567754107.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103348i1FB7CE1E8CF88594/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_3-1679567754107.png" alt="Vincenzo_Esposito_3-1679567754107.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;And in the header the authorization Bearer as follow:&lt;/P&gt;
&lt;P class="lia-align-center"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vincenzo_Esposito_4-1679567787421.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103349i55E357D235312985/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_4-1679567787421.png" alt="Vincenzo_Esposito_4-1679567787421.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="lia-align-left"&gt;Next step is updating the nextPage Token for the next iteration:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_5-1679567817637.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103350i4CCF0DB92BAE90CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_5-1679567817637.png" alt="Vincenzo_Esposito_5-1679567817637.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Loop over the list of members coming from the API Call.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_6-1679567851455.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103351i672C2ABA1654E812/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_6-1679567851455.png" alt="Vincenzo_Esposito_6-1679567851455.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Now, for each iteration we can finally check if the user just created is in the list with a simple condition Block. If it is in the list, we can assign a license and grant the user to one or more spaces. If it is not, just go for the next iteration.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_7-1679567887440.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103352iF941028849C391D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_7-1679567887440.png" alt="Vincenzo_Esposito_7-1679567887440.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Once the iterations on the pages is over and the user was not found, we know he/she is not among the list of authorized users, thus we can get further action such as disable it.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_8-1679567916515.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103353i8CA10C111C9CFFFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_8-1679567916515.png" alt="Vincenzo_Esposito_8-1679567916515.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here attached to this article you can find the Automation. Remember to replace the placeholder in the Variable Private Key Id and Variable Private Key with your own keys as well as the group in the two call url blocks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 10:56:11 GMT</pubDate>
    <dc:creator>Vincenzo_Esposito</dc:creator>
    <dc:date>2023-03-23T10:56:11Z</dc:date>
    <item>
      <title>Manage GCP Group with Qlik Automation</title>
      <link>https://community.qlik.com/t5/Member-Articles/Manage-GCP-Group-with-Qlik-Automation/ta-p/2050705</link>
      <description>&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;By the time I’m writing this article Qlik Cloud Service does not support yet the GCP user group during the authentication phase. Thus allow GCP users to access Qlik Cloud, base on their groups is not (yet) an option.&lt;/P&gt;
&lt;P&gt;This is expected to be a temporary situation and Qlik will deliver soon (or later) also this feature. Nevertheless timing is important and it may avoid the SaaS adoption for Qlik enthusiast with the hard constraint to relay on Google groups.&lt;/P&gt;
&lt;P&gt;In the context above, in this article I'm going to propose an alternative way to achieve the same business scope &lt;SPAN&gt;granting users to spaces based on their membership groups. Therefore, acting on the Authorization instead, the Authentication. This solution is imperfect, widely improvable (anyone is welcome to contribute) and to some extent graceless, but it just works and sometime could make the difference between adopting Qlik SaaS or something else.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;Qlik Cloud Service&lt;/LI&gt;
&lt;LI&gt;Qlik Application Automation&lt;/LI&gt;
&lt;LI&gt;GCP Directory API&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Resolution&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Any authenticated user (through GCP or any other solution) will land on Qlik Cloud creating a new user for their first access. This solution is triggered on that specific event “User Creation”. &lt;LI-PRODUCT title="Qlik Application Automation" id="qlikApplicationAutomation"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp; is triggered on the User creation event, and go through the following steps&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Invoke the Google Directory API and retrieve the list of authorized users.&lt;/LI&gt;
&lt;LI&gt;Check the new created user is among this list.&lt;/LI&gt;
&lt;LI&gt;If the user is authorized to access, then assign a license and grants for the authorized spaces.&lt;/LI&gt;
&lt;LI&gt;If the user is not authorized, then the automation disables it.&lt;/LI&gt;
&lt;/UL&gt;
&lt;H4&gt;Google API Call&lt;/H4&gt;
&lt;P&gt;Here you can find the Google API &lt;A title="Google Developer Documentation" href="https://developers.google.com/admin-sdk/directory/reference/rest/v1/members/list?hl=en" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt; . The HTTP request retrieve a paginated list of users belonging to the same {groupKey}. This HTTP request needs an authentication&amp;nbsp;method, for this you need to &lt;A title="Google developers documentation" href="https://developers.google.com/identity/protocols/oauth2/service-account#creatinganaccount" target="_blank" rel="noopener"&gt;create a service account&lt;/A&gt; on the google platform.&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Follow the instruction &lt;A href="https://developers.google.com/identity/protocols/oauth2/service-account#python" target="_self"&gt;here&lt;/A&gt; to get the user account, the private key and the private key id.&lt;/LI&gt;
&lt;LI&gt;Set the start Block as:
&lt;UL&gt;
&lt;LI&gt;Run Mode : Webhook&lt;/LI&gt;
&lt;LI&gt;Connector : Qlik Cloud Service&lt;/LI&gt;
&lt;LI&gt;Event : User Created&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;From the Qlik Cloud Service Connector use the Get User Block to get the user details from the user just created&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_0-1679567200500.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103342i2882BFF852DE28E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_0-1679567200500.png" alt="Vincenzo_Esposito_0-1679567200500.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Next step is getting the Bearer Token for the REST call. Use two variable blokes to store the Private Key and&amp;nbsp;the Private Key Id.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vincenzo_Esposito_1-1679567241223.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103343i82E79FA68265BC52/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_1-1679567241223.png" alt="Vincenzo_Esposito_1-1679567241223.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Pay attention to paste the Private Key. It is made of 3 lines. The first line is the “BEGIN PRIVATE KEY” the second line is the key itself &lt;STRONG&gt;without any carriage return line feed&lt;/STRONG&gt;, the third line is the “END PRIVATE KEY” line. You should end up with something like this:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;-----BEGIN PRIVATE KEY-----&lt;/EM&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;&amp;lt;Your private Key in one single line, remove all the CR+LF or /n&amp;gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;-----END PRIVATE KEY-----&lt;/EM&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="lia-align-left"&gt;Use a custom code block to get the Bearer token. You need to pass 3 inputs to the custom block&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_2-1679567325440.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103344i44AF7586514F2854/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_2-1679567325440.png" alt="Vincenzo_Esposito_2-1679567325440.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Private Key id from the variable&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Private Key from the variable&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Time as: {number: {date: 'now', 'U'}}&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Select Python as language and paste these lines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import jwt

iat = inputs['time'] 
exp = iat + 3600 * 1000
payload = {'iss': 'qlik-user-sync@qliksaasidp-377811.iam.gserviceaccount.com',
           'sub': 'qlik-user-sync@qliksaasidp-377811.iam.gserviceaccount.com',
           'aud': 'https://admin.googleapis.com/',
           'iat': iat,
           'exp': exp}
additional_headers = {'kid': inputs['Private Key Id'],"alg": "RS256","typ": "JWT"}

signed_jwt = jwt.encode(payload, inputs['Private Key'], headers=additional_headers,
                       algorithm='RS256')
print (signed_jwt)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;For more details please check &lt;A href="https://developers.google.com/identity/protocols/oauth2/service-account#python" target="_blank" rel="noopener"&gt;this&lt;/A&gt; page.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Next steps need to manage the multipage. Use a new variable, call it pageToken and set as empty string.&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_0-1679567604814.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103345iDFE76B0429EC73AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_0-1679567604814.png" alt="Vincenzo_Esposito_0-1679567604814.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;The following 3 steps get the number of users the query will retrieve and create an array with the number of pages to read.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_1-1679567682445.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103346iF1AE0D7353E8AA3D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_1-1679567682445.png" alt="Vincenzo_Esposito_1-1679567682445.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Inside the Loop, as first step let’s call the Google Directory API. Use the Call URL Block. You can find the documentation on how to use it at &lt;A href="https://developers.google.com/admin-sdk/directory/reference/rest/v1/members/list?hl=en" target="_blank" rel="noopener"&gt;this&lt;/A&gt; page.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_2-1679567717160.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103347i4EB332DC88D05069/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_2-1679567717160.png" alt="Vincenzo_Esposito_2-1679567717160.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;Remember to use as parameter the pageToken&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_3-1679567754107.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103348i1FB7CE1E8CF88594/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_3-1679567754107.png" alt="Vincenzo_Esposito_3-1679567754107.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;And in the header the authorization Bearer as follow:&lt;/P&gt;
&lt;P class="lia-align-center"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vincenzo_Esposito_4-1679567787421.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103349i55E357D235312985/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_4-1679567787421.png" alt="Vincenzo_Esposito_4-1679567787421.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="lia-align-left"&gt;Next step is updating the nextPage Token for the next iteration:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_5-1679567817637.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103350i4CCF0DB92BAE90CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_5-1679567817637.png" alt="Vincenzo_Esposito_5-1679567817637.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Loop over the list of members coming from the API Call.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_6-1679567851455.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103351i672C2ABA1654E812/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_6-1679567851455.png" alt="Vincenzo_Esposito_6-1679567851455.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Now, for each iteration we can finally check if the user just created is in the list with a simple condition Block. If it is in the list, we can assign a license and grant the user to one or more spaces. If it is not, just go for the next iteration.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_7-1679567887440.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103352iF941028849C391D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_7-1679567887440.png" alt="Vincenzo_Esposito_7-1679567887440.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Once the iterations on the pages is over and the user was not found, we know he/she is not among the list of authorized users, thus we can get further action such as disable it.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Vincenzo_Esposito_8-1679567916515.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103353i8CA10C111C9CFFFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vincenzo_Esposito_8-1679567916515.png" alt="Vincenzo_Esposito_8-1679567916515.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here attached to this article you can find the Automation. Remember to replace the placeholder in the Variable Private Key Id and Variable Private Key with your own keys as well as the group in the two call url blocks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 10:56:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Member-Articles/Manage-GCP-Group-with-Qlik-Automation/ta-p/2050705</guid>
      <dc:creator>Vincenzo_Esposito</dc:creator>
      <dc:date>2023-03-23T10:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Manage GCP Group with Qlik Automation</title>
      <link>https://community.qlik.com/t5/Member-Articles/Manage-GCP-Group-with-Qlik-Automation/tac-p/2145302#M2122</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/44185"&gt;@Vincenzo_Esposito&lt;/a&gt;&amp;nbsp; thanks for creating this documentation. I had a question about its functionality. Is the idea that only 1 Google IDP group is queried? If I want to use Google's IDP groups to control who has access to which space (for example, a Sales group in Google will have access to a Sales space in Qlik, and then a Finance Google group will have access to the Finance space in Qlik), is that achievable with your workaround?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 14:04:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Member-Articles/Manage-GCP-Group-with-Qlik-Automation/tac-p/2145302#M2122</guid>
      <dc:creator>alphabutter9</dc:creator>
      <dc:date>2023-12-07T14:04:38Z</dc:date>
    </item>
  </channel>
</rss>

