<?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: Java SDK connect with sessionKey in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134065#M1920</link>
    <description>&lt;P&gt;the sdk is quite well documented. have a look at: &lt;A href="http://dev.splunk.com/java"&gt;http://dev.splunk.com/java&lt;/A&gt; and the examples.&lt;BR /&gt;
the setToken method is docmentented here: &lt;A href="http://docs.splunk.com/DocumentationStatic/JavaSDK/1.6.4/com/splunk/ServiceArgs.html#setToken-java.lang.String-"&gt;http://docs.splunk.com/DocumentationStatic/JavaSDK/1.6.4/com/splunk/ServiceArgs.html#setToken-java.lang.String-&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 06 May 2018 13:40:26 GMT</pubDate>
    <dc:creator>lweber</dc:creator>
    <dc:date>2018-05-06T13:40:26Z</dc:date>
    <item>
      <title>Java SDK connect with sessionKey</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134060#M1915</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;because it took me a while to figure out, I'll post the question and give the answer myself...&lt;/P&gt;

&lt;P&gt;Using the documentation I did not figure out how I can connect to Splunk using a session key (eg. passed from a python script via passAuth).&lt;/P&gt;

&lt;P&gt;The documentation is showing an example using the &lt;CODE&gt;Service.login(...)&lt;/CODE&gt; and the &lt;CODE&gt;Service.setToken(String token)&lt;/CODE&gt;method, the latter was used for a base64 encripted &lt;CODE&gt;username:password&lt;/CODE&gt; token.&lt;/P&gt;

&lt;P&gt;answer will follow in a second...&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2015 19:38:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134060#M1915</guid>
      <dc:creator>lweber</dc:creator>
      <dc:date>2015-06-02T19:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK connect with sessionKey</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134061#M1916</link>
      <description>&lt;P&gt;it's simple as this &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Service.setToken("Splunk sessionKey")&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;btw:&lt;BR /&gt;
in the example: &lt;A href="http://dev.splunk.com/view/java-sdk/SP-CAAAECX"&gt;http://dev.splunk.com/view/java-sdk/SP-CAAAECX&lt;/A&gt; you're using &lt;CODE&gt;com.sun.org.apache.xerces.internal.impl.dv.util.Base64&lt;/CODE&gt; to encode the &lt;CODE&gt;user:password&lt;/CODE&gt; token. It is always a bad (!) idea to use code placed in class placed in a &lt;CODE&gt;internal&lt;/CODE&gt;package.&lt;BR /&gt;
Use: &lt;CODE&gt;java.util.Base64&lt;/CODE&gt; instead.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2015 19:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134061#M1916</guid>
      <dc:creator>lweber</dc:creator>
      <dc:date>2015-06-02T19:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK connect with sessionKey</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134062#M1917</link>
      <description>&lt;P&gt;How to get sessionKey for particular splunk db&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 14:11:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134062#M1917</guid>
      <dc:creator>npbala_22</dc:creator>
      <dc:date>2018-03-15T14:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK connect with sessionKey</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134063#M1918</link>
      <description>&lt;P&gt;depends where you want to use it.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;in plain Java you need to login first. &lt;A href="http://docs.splunk.com/DocumentationStatic/JavaSDK/1.6.4/com/splunk/Service.html#getToken--"&gt;Service.getToken&lt;/A&gt;, you can use the sessionkey from you browser session, but it will expire.&lt;/LI&gt;
&lt;LI&gt;if you java code gets called from a REST endpoint (python) which extends splunk.rest.BaseRestHandler you already have it in your class (self.sessionKey).&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 20 Mar 2018 09:32:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134063#M1918</guid>
      <dc:creator>lweber</dc:creator>
      <dc:date>2018-03-20T09:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK connect with sessionKey</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134064#M1919</link>
      <description>&lt;P&gt;can you share the piece of your code which uses the Splunk session key to connect and create/poll/consume the search !&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 18:13:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134064#M1919</guid>
      <dc:creator>sathishraja92</dc:creator>
      <dc:date>2018-05-04T18:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK connect with sessionKey</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134065#M1920</link>
      <description>&lt;P&gt;the sdk is quite well documented. have a look at: &lt;A href="http://dev.splunk.com/java"&gt;http://dev.splunk.com/java&lt;/A&gt; and the examples.&lt;BR /&gt;
the setToken method is docmentented here: &lt;A href="http://docs.splunk.com/DocumentationStatic/JavaSDK/1.6.4/com/splunk/ServiceArgs.html#setToken-java.lang.String-"&gt;http://docs.splunk.com/DocumentationStatic/JavaSDK/1.6.4/com/splunk/ServiceArgs.html#setToken-java.lang.String-&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 13:40:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134065#M1920</guid>
      <dc:creator>lweber</dc:creator>
      <dc:date>2018-05-06T13:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK connect with sessionKey</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134066#M1921</link>
      <description>&lt;P&gt;Thanks. It worked&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 10:12:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134066#M1921</guid>
      <dc:creator>sathishraja92</dc:creator>
      <dc:date>2018-05-10T10:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK connect with sessionKey</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134067#M1922</link>
      <description>&lt;P&gt;The session key gets added in a cookie which browser uses on the subsequent search call.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 22:59:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-SDK-connect-with-sessionKey/m-p/134067#M1922</guid>
      <dc:creator>mishiehow</dc:creator>
      <dc:date>2019-02-19T22:59:43Z</dc:date>
    </item>
  </channel>
</rss>

