<?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: C# API: Getting 403 when calling service.LogOffAsync() in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/C-API-Getting-403-when-calling-service-LogOffAsync/m-p/216858#M2856</link>
    <description>&lt;P&gt;Bump - no Splunk support want to weigh in?&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2016 14:33:47 GMT</pubDate>
    <dc:creator>howlingfang</dc:creator>
    <dc:date>2016-07-14T14:33:47Z</dc:date>
    <item>
      <title>C# API: Getting 403 when calling service.LogOffAsync()</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/C-API-Getting-403-when-calling-service-LogOffAsync/m-p/216857#M2855</link>
      <description>&lt;P&gt;I am able to use the C# API to connect to our Splunk server and to perform searches and retrieve the results.  If I just let the program end without calling LogOffAsync, all is good and the process ends.  If I try and be a good client citizen and call LogOffAsync before terminating the program, the LogOff call is resulting in an Exception with the following exception detail:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;System.AggregateException was unhandled
  HResult=-2146233088
  Message=One or more errors occurred.
  Source=mscorlib
  StackTrace:
       at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
       at System.Threading.Tasks.Task.Wait()
       at RestClient.Program.Main(String[] args) in c:\source\sandbox\SplunkHelloWorld\SplunkHelloWorld\Program.cs:line 29
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: Splunk.Client.UnauthorizedAccessException
       HResult=-2146233088
       Message=403: Forbidden
  Error: 
 In handler 'httpauth-tokens': You (user=[my splunk user]) do not have permission to perform this operation (requires capability: edit_httpauths).
       Source=Splunk.Client
       StackTrace:
            at Splunk.Client.Response.&amp;lt;ThrowRequestExceptionAsync&amp;gt;d__17.MoveNext()
         --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
            at Splunk.Client.Response.&amp;lt;EnsureStatusCodeAsync&amp;gt;d__11.MoveNext()
         --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
            at Splunk.Client.Service.&amp;lt;LogOffAsync&amp;gt;d__36.MoveNext()
         --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
            at RestClient.Program.&amp;lt;ConnectSplunkSdk&amp;gt;d__16.MoveNext() in
my program
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It doesn't seem reasonable that I would have to have edit_httpauths permission just to LogOff.  Am I missing something?  Why would it be excepting?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 17:26:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/C-API-Getting-403-when-calling-service-LogOffAsync/m-p/216857#M2855</guid>
      <dc:creator>howlingfang</dc:creator>
      <dc:date>2016-06-22T17:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: C# API: Getting 403 when calling service.LogOffAsync()</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/C-API-Getting-403-when-calling-service-LogOffAsync/m-p/216858#M2856</link>
      <description>&lt;P&gt;Bump - no Splunk support want to weigh in?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 14:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/C-API-Getting-403-when-calling-service-LogOffAsync/m-p/216858#M2856</guid>
      <dc:creator>howlingfang</dc:creator>
      <dc:date>2016-07-14T14:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: C# API: Getting 403 when calling service.LogOffAsync()</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/C-API-Getting-403-when-calling-service-LogOffAsync/m-p/216859#M2857</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;  In handler 'httpauth-tokens': You (user=[my splunk user]) do not have permission to perform this operation (requires capability: edit_httpauths)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So what happens if you give your role the "edit_httpauths" capability?&lt;/P&gt;

&lt;P&gt;It's perfectly reasonable in my opinion. It's obvious the call to service.LogOffAsync requires this capability/privilege.  It probably resets the users auth token or something more that you're not thinking it does.  I have never pressed a "logout" button in Splunk. Have you?  It's not required IMHO and I think you're going above and beyond and creating trouble for yourself.&lt;/P&gt;

&lt;P&gt;If you want Splunk support, submitt a ticket.  &lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 11:53:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/C-API-Getting-403-when-calling-service-LogOffAsync/m-p/216859#M2857</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-07-19T11:53:00Z</dc:date>
    </item>
  </channel>
</rss>

