title: Non-interactive login (cached credentials) against Azure Graph API on iOS
body: <p>I am creating an app on iOS that will run in a "kiosk" mode.  Part of the application requires users to be able to search an organisation's directory.  I would like to support Azure AD via the Azure Graph API to provide this function.</p>
  
  <p>I don't want to require an interactive login when the app starts and I don't want to have to use an additional web service; I would like for the iOS app to simply access the Azure Graph API via REST.</p>
  
  <p>I am aware of the risks associated with cached credentials, however the use of "service accounts" for non-interactive logins is fairly well established, the access is read-only and the credentials can be secured in the iOS keychain.</p>
  
  <p>I have looked through numerous Azure samples and read the documentation and it seems that the method that provides what I need <a href="https://msdn.microsoft.com/en-us/library/dn479466.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollow"><code>acquireToken(resource, credential)</code></a> isn't available in the iOS ADAL library (and either is the <code>ClientCredential</code> class).</p>
  
  <p>To clarify, this is how I would like my app to work:</p>
  
  <ol>
  <li>User installs the app from the app store and runs it the first time</li>
  <li>As part of the setup they authenticate to Azure AD by providing their tenant,  application client ID and an application key.  If they can't authenticate with an application key, a user id/password is acceptable as long as:</li>
  <li>They never get prompted to authenticate again</li>
  </ol>
  
  <p>Is there a solution here or do I just give up on Azure AD?</p>