<?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 QRS API with Powershell and Domain Creds in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-with-Powershell-and-Domain-Creds/m-p/1771197#M13673</link>
    <description>&lt;P&gt;Below is the code snippet from QRS API Documentation for powershell&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
$url = "https://servername/qrs/about?xrfkey=12345678qwertyui"
Invoke-RestMethod -Uri $url -Method Get -Headers $hdrs -UseDefaultCredentials&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do we make this work with another set of domain credentials rather than using Default Credentials or Certificate? I tired the -cred parameter, wrapping them in to basic auth header, nothing works unforunately.&lt;BR /&gt;&lt;BR /&gt;Anybody here has an example or suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:53:11 GMT</pubDate>
    <dc:creator>amalsyed93</dc:creator>
    <dc:date>2024-11-16T00:53:11Z</dc:date>
    <item>
      <title>QRS API with Powershell and Domain Creds</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-with-Powershell-and-Domain-Creds/m-p/1771197#M13673</link>
      <description>&lt;P&gt;Below is the code snippet from QRS API Documentation for powershell&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
$url = "https://servername/qrs/about?xrfkey=12345678qwertyui"
Invoke-RestMethod -Uri $url -Method Get -Headers $hdrs -UseDefaultCredentials&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do we make this work with another set of domain credentials rather than using Default Credentials or Certificate? I tired the -cred parameter, wrapping them in to basic auth header, nothing works unforunately.&lt;BR /&gt;&lt;BR /&gt;Anybody here has an example or suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:53:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-with-Powershell-and-Domain-Creds/m-p/1771197#M13673</guid>
      <dc:creator>amalsyed93</dc:creator>
      <dc:date>2024-11-16T00:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API with Powershell and Domain Creds</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-with-Powershell-and-Domain-Creds/m-p/1773548#M13694</link>
      <description>&lt;P&gt;Invoke-RestMethod automatically follows redirection.&lt;/P&gt;&lt;P&gt;however, it does not pass the supplied credentials to the redirected URL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to get around this, we need to break the automatic redirection, identify the redirection URI and authenticate against that.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$cred = Get-Credential 

$url = "https://servername/qrs/about?xrfkey=12345678qwertyui"

$Result = Invoke-WebRequest -Method Get -Uri $url -MaximumRedirection 0 -ErrorAction SilentlyContinue -Credential $cred -Headers $hdrs   

#Get the Auth URL
$AuthURL = $Result.Headers.Location

#Authenticate to the AuthURL, and create a SessionVariable 
$Results = Invoke-RestMethod -Method Get -Uri $AuthURL -ErrorAction SilentlyContinue -Credential $cred -Headers $hdrs -SessionVariable AuthenticatedSession

#Subsequent requests can use the Session variable
Invoke-RestMethod -WebSession $AuthenticatedSession -Uri $URL&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 00:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-with-Powershell-and-Domain-Creds/m-p/1773548#M13694</guid>
      <dc:creator>Marc</dc:creator>
      <dc:date>2021-01-12T00:08:48Z</dc:date>
    </item>
  </channel>
</rss>

