<?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>topic Re: Qlik Sense SaaS - Generating an api-key in an authenticated mashup in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890654#M16258</link>
    <description>&lt;P&gt;Thanks for the attention. However, I don't see the example described in your reply invoking the create API key REST endpoint.&amp;nbsp;&lt;A href="https://qlik.dev/apis/rest/api-keys/#%23%2Fentries%2Fapi-keys-post" target="_self"&gt;Create API Key&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This looks like it opens an App and pulls some content back to the html page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The crux of my problem is being able to create a new api key from a mashup which has been authenticated to Qlik SaaS&lt;/P&gt;
&lt;P&gt;I appreciate the reply,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Dan&lt;/P&gt;</description>
    <pubDate>Tue, 08 Feb 2022 21:53:09 GMT</pubDate>
    <dc:creator>1emerson</dc:creator>
    <dc:date>2022-02-08T21:53:09Z</dc:date>
    <item>
      <title>Qlik Sense SaaS - Generating an api-key in an authenticated mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1887161#M16214</link>
      <description>&lt;P&gt;Is it possible to generate an api-key for my user from within an authenticated mashup?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a mashup that has been authenticated successfully according to the instructions here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://qlik.dev/basics/build-web-solutions#single-sign-on" target="_self"&gt;Single Sign On&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The mashup is able to make subsequent calls to query the api-keys endpoint in order to determine whether the current user has an api-key. Therefore I am certain I have configured and connected to my tenant from within the mashup.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sticky point is when the code attempts to create a new api-key&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="javascript"&gt;        fetch("https://"+config.host+"/api/v1/api-keys", {
            method: 'POST',
            mode:'cors',
            credentials: 'include',
            headers: {
               'Content-Type': 'application/json',
               'qlik-web-integration-id': config.webIntegrationId,
               'qlik-csrf-token': csrfToken
            },
            body : JSON.stringify({
            "description": 'my-generated-key',
            "subType": "user",
            "sub": &amp;lt;my user id&amp;gt;
         })
         })&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;This results in a 403 forbidden response.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the user already has a known&lt;EM&gt; api-key&lt;/EM&gt;, then I'm able to generate new ones by passing the &lt;FONT face="courier new,courier"&gt;Authorization&lt;/FONT&gt; header as described in the REST documentation.&amp;nbsp; However, the use case dictates that the user &lt;STRONG&gt;may not&lt;/STRONG&gt; already have a known&lt;EM&gt; api-key&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 15:27:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1887161#M16214</guid>
      <dc:creator>1emerson</dc:creator>
      <dc:date>2022-01-31T15:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense SaaS - Generating an api-key in an authenticated mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890632#M16256</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Try this JS :&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-javascript"&gt;&lt;CODE&gt;var config = {
    host: 'yourtenant.eu.qlikcloud.com',
    prefix: '/',
    port: 443,
    isSecure: true,
    webIntegrationId: '0pEp-l03lPxDawQxhOSWjKqO_Ckw1WYn'
};

//Redirect to login if user is not logged in
async function login() {
      function isLoggedIn() {
        return fetch("https://"+config.host+"/api/v1/users/me", {
          method: 'GET',
          mode: 'cors',
          credentials: 'include',
          headers: {
            'Content-Type': 'application/json',
            'qlik-web-integration-id': config.webIntegrationId,
          },
        }).then(response =&amp;gt; {
          return response.status === 200;
        });
      }
      return isLoggedIn().then(loggedIn =&amp;gt; {
        if (!loggedIn) {	  
            window.location.href = "https://"+config.host+"/login?qlik-web-integration-id=" + config.webIntegrationId + "&amp;amp;returnto=" + location.href;
            throw new Error('not logged in');
        }
      });
    }
login().then(() =&amp;gt; {
    require.config( {
    baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources",
    webIntegrationId: config.webIntegrationId
} );			

require( ["js/qlik"], function ( qlik ) {
	qlik.on( "error", function ( error ) {
		$( '#popupText' ).append( error.message + "&amp;lt;br&amp;gt;" );
		$( '#popup' ).fadeIn( 1000 );
	} );
	$( "#closePopup" ).click( function () {
		$( '#popup' ).hide();
	} );
    //open apps -- inserted here --
	var app = qlik.openApp( '8120d03d-3902-4f4e-b0f1-3fee539227ad', config );
	
    //get objects -- inserted here --
	app.visualization.get('DKnjQAk').then(function(vis){
    vis.show("QV01");	
	} );
    
} );});&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Credit full reference link&amp;nbsp; :&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Knowledge/How-to-create-a-mashup-in-Qlik-Sense-Enterprise-on-SaaS/ta-p/1767294" target="_blank"&gt;https://community.qlik.com/t5/Knowledge/How-to-create-a-mashup-in-Qlik-Sense-Enterprise-on-SaaS/ta-p/1767294&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 20:49:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890632#M16256</guid>
      <dc:creator>Akshesh_Patel</dc:creator>
      <dc:date>2022-02-08T20:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense SaaS - Generating an api-key in an authenticated mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890654#M16258</link>
      <description>&lt;P&gt;Thanks for the attention. However, I don't see the example described in your reply invoking the create API key REST endpoint.&amp;nbsp;&lt;A href="https://qlik.dev/apis/rest/api-keys/#%23%2Fentries%2Fapi-keys-post" target="_self"&gt;Create API Key&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This looks like it opens an App and pulls some content back to the html page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The crux of my problem is being able to create a new api key from a mashup which has been authenticated to Qlik SaaS&lt;/P&gt;
&lt;P&gt;I appreciate the reply,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 21:53:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890654#M16258</guid>
      <dc:creator>1emerson</dc:creator>
      <dc:date>2022-02-08T21:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense SaaS - Generating an api-key in an authenticated mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890657#M16259</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks, what I am thinking is that&amp;nbsp;&lt;SPAN&gt;to generate or delete&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN data-mc-conditions="Targets.NotToTranslate"&gt;API&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;keys, you must have the role&amp;nbsp;of&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="path"&gt;developer&lt;/SPAN&gt;&lt;SPAN&gt;. Does the user have at least a developer role and professional license assigned in SaaS?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 21:57:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890657#M16259</guid>
      <dc:creator>Akshesh_Patel</dc:creator>
      <dc:date>2022-02-08T21:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense SaaS - Generating an api-key in an authenticated mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890663#M16260</link>
      <description>&lt;P&gt;Yes, the user has the role of Developer and is designated as "Professional".&lt;/P&gt;
&lt;P&gt;I'm able to create new keys for this user with the REST API (by passing the Authorization header with an existing api key). So I am pretty sure that the entitlements are correct.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 22:08:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890663#M16260</guid>
      <dc:creator>1emerson</dc:creator>
      <dc:date>2022-02-08T22:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense SaaS - Generating an api-key in an authenticated mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890696#M16261</link>
      <description>&lt;P&gt;did you check in the developer tool and see if any CSPs are blocking the request and try adding that to SaaS?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 03:01:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1890696#M16261</guid>
      <dc:creator>Akshesh_Patel</dc:creator>
      <dc:date>2022-02-09T03:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense SaaS - Generating an api-key in an authenticated mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1891104#M16271</link>
      <description>&lt;P&gt;I guess I'm not connecting the dots with the Content Security Policy recommendation as to how that might help. My mashup is able to invoke other REST API requests. For example, I can successfully describe an exiting API key (using the GET /api-keys/{id}) after the mashup is authenticated. Therefore the Content Security Policy is allowing requests, just not the &lt;STRONG&gt;specific&lt;/STRONG&gt;&amp;nbsp;create API key request mentioned above.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1891104#M16271</guid>
      <dc:creator>1emerson</dc:creator>
      <dc:date>2022-02-09T16:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense SaaS - Generating an api-key in an authenticated mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1891355#M16272</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/163563"&gt;@1emerson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have checked internally with our R&amp;amp;D and this is a product limitation.&lt;/P&gt;
&lt;P&gt;"Admin" and "Developer" roles are stripped off the request when running in CORS mode and as generating an API key requires the "Developer" role then it's not possible to perform that action in a mashup.&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 07:32:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1891355#M16272</guid>
      <dc:creator>Damien_V</dc:creator>
      <dc:date>2022-02-10T07:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense SaaS - Generating an api-key in an authenticated mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1892118#M16281</link>
      <description>&lt;P&gt;I sort of suspected as much. The documentation was pretty clear &lt;A href="https://qlik.dev/basics/authentication-options#web-integrations" target="_self"&gt;here&lt;/A&gt; regarding disallowing operations involving TenantAdmin role within a web integration. It also does state what you wrote about running as a "regular user".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for confirming that Developer operations are also restricted to using API Keys.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 19:09:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-SaaS-Generating-an-api-key-in-an-authenticated-mashup/m-p/1892118#M16281</guid>
      <dc:creator>1emerson</dc:creator>
      <dc:date>2022-02-11T19:09:27Z</dc:date>
    </item>
  </channel>
</rss>

