<?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: [resolved] tREST and Authentication in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-tREST-and-Authentication/m-p/2333093#M101908</link>
    <description>Solution: 
&lt;BR /&gt;in a tJavaComponent, go to athe advanced settings and add the following import: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;import com.sun.jersey.core.util.Base64;&lt;/PRE&gt; 
&lt;BR /&gt;In the basic settings, add the following code: 
&lt;BR /&gt; 
&lt;PRE&gt;String pair = "&amp;lt;username&amp;gt;:&amp;lt;password&amp;gt;";&lt;BR /&gt;byte[] encodedBytes = Base64.encode(pair.getBytes());&lt;BR /&gt;globalMap.put("authorization", new String(encodedBytes));&lt;BR /&gt;System.out.println(globalMap.get("authorization"));&lt;/PRE&gt; 
&lt;BR /&gt;Now connect the tJava to the tRest using the OnComponentOk trigger. 
&lt;BR /&gt;In the tRest, add a HTTP Header called "Authorzation" and set it to "Basic " + (String)globalMap.get("authorization"): 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAr4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150545i48EF0227699A8C6B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAr4.png" alt="0683p000009MAr4.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Tue, 07 Oct 2014 18:55:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-10-07T18:55:47Z</dc:date>
    <item>
      <title>[resolved] tREST and Authentication</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tREST-and-Authentication/m-p/2333092#M101907</link>
      <description>How may I authenticate to an endpoint using Basic Authentication with the tREST component?</description>
      <pubDate>Tue, 07 Oct 2014 18:34:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tREST-and-Authentication/m-p/2333092#M101907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-07T18:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tREST and Authentication</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tREST-and-Authentication/m-p/2333093#M101908</link>
      <description>Solution: 
&lt;BR /&gt;in a tJavaComponent, go to athe advanced settings and add the following import: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;import com.sun.jersey.core.util.Base64;&lt;/PRE&gt; 
&lt;BR /&gt;In the basic settings, add the following code: 
&lt;BR /&gt; 
&lt;PRE&gt;String pair = "&amp;lt;username&amp;gt;:&amp;lt;password&amp;gt;";&lt;BR /&gt;byte[] encodedBytes = Base64.encode(pair.getBytes());&lt;BR /&gt;globalMap.put("authorization", new String(encodedBytes));&lt;BR /&gt;System.out.println(globalMap.get("authorization"));&lt;/PRE&gt; 
&lt;BR /&gt;Now connect the tJava to the tRest using the OnComponentOk trigger. 
&lt;BR /&gt;In the tRest, add a HTTP Header called "Authorzation" and set it to "Basic " + (String)globalMap.get("authorization"): 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAr4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150545i48EF0227699A8C6B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAr4.png" alt="0683p000009MAr4.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Tue, 07 Oct 2014 18:55:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tREST-and-Authentication/m-p/2333093#M101908</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-07T18:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tREST and Authentication</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tREST-and-Authentication/m-p/2333094#M101909</link>
      <description>How can I also add the Domain to the request??</description>
      <pubDate>Mon, 17 Oct 2016 10:58:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tREST-and-Authentication/m-p/2333094#M101909</guid>
      <dc:creator>jasbir_purewal</dc:creator>
      <dc:date>2016-10-17T10:58:17Z</dc:date>
    </item>
  </channel>
</rss>

