title: AquireTokenAsync with old access token ADAL
body: <p>I am developing an app on Xamarin. I am trying to implement a single sign on across multiple apps. For this I authenticate the user first time with Azure AD using ADAL and user enters the credentials in the O365 page displayed by ADAL in the <code>AcquireTokenAsync()</code>. </p>
  
  <pre><code>var  authContext = new AuthenticationContext(ServiceConstants.AUTHORITY);
  var  authResult = await authContext.AcquireTokenAsync(resourceUri, ServiceConstants.CLIENTID, ServiceConstants.RETURNURI, param);
  var apiAccessToken = authResult.AccessToken;
  </code></pre>
  
  <p>When successfully authenticated, I save the received token to a file which does persists even if the user uninstalls the app. </p>
  
  <p>Now next time the user starts the app, I pass the saved token to the 
  <code>AcquireTokenAsync()</code> as <code>UserAssertion</code></p>
  
  <pre><code>//Pass old accessToken
  var userAssertion = new UserAssertion(accessToken);
  var authResult = await authContext.AcquireTokenAsync(resourceUri, ServiceConstants.CLIENTID, userAssertion);
  </code></pre>
  
  <p>This works as expected and the user is authenticated without showing the O365 login screen.</p>
  
  <p>Now I want this same behavior when the user uninstalls the app and reinstalls it. In my case, when the user uninstalls and reinstalls the app, I try to get a fresh token in the same way by adding the saved token as <code>UserAssertion</code> to the <code>AquireTokenAsync()</code>. However I get an error like so :-</p>
  
  <pre><code>Invalid JWT token. Token format not valid.
  </code></pre>
  
  <p>I cross checked the Token via Postman and it is a valid token. </p>
  
  <p><strong>EDIT</strong>
  <a href="https://i.stack.imgur.com/2g55a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2g55a.png" alt="enter image description here"></a></p>
  
  <p>Any idea on how I can resolve this? Or a better way I can implement the same? Any help is highly appreciated.</p>