title: MobileFirst OAuth and Logout
body: <p>I have a test application that accesses two Adapters:</p>
  
  <ol>
  <li>A JavaScript adapter protected by a SecurityTest referencing a realm</li>
  <li>A Java adapter with a method protected by an OAuth scope corresponding to that same realm.</li>
  </ol>
  
  <p>If I follow this sequence everything works as expected:</p>
  
  <ol>
  <li>Attempt to access the JS adapter, I get challenged, authenticate, get data.</li>
  <li>WL.Client.isUserAuthenticated() and WL.Client.getUserInfo() now behave as expected</li>
  <li>Logout using WL.Client.logout()</li>
  <li>WL.Client.isUserAuthenticated() now shows I'm not authenticated</li>
  <li>A second attempt to access the JS adapter causes another Challenge, as expeccted.</li>
  </ol>
  
  <p>However, with the Java Adapter logout() seems not to behave as expected.</p>
  
  <ol>
  <li>Starting with no session, attempt to access the Java adapter, the challenge happens as expected and I get to my data</li>
  <li>I can now access the JS adapter without further challenge and the WL.Client.getUserInfo() calls gives the expected results.</li>
  <li>WL.Client.logout() appears to work, in that WL.Client.isUserAuthenticated() now shows I'm not authenticated</li>
  <li><strong>But</strong> a call to the Java adapter still works without further challenge</li>
  <li>A call to the JS adapter does result in a challenge</li>
  </ol>
  
  <p>If I'm running in my browser simulator environment I can destroy the OAuth session  by using this command:</p>
  
  <pre><code> localStorage.removeItem("com.worklight.oauth.idtoken")
  </code></pre>
  
  <p>The question is:</p>
  
  <p>Should the WL.Client.logout() method have destroyed the OAuth session? If not what API should I be using?</p>