title: PP_E_RPS_CERT_NOT_FOUND error when querying Outlook API
body: <p>I am trying to retrieve the contents of my calendar using the Outlook REST API, but I am getting weird error responses.</p>
  
  <p>The code is based on the example code supplied by Microsoft in <a href="https://github.com/microsoftgraph/php-connect-rest-sample" rel="nofollow noreferrer">https://github.com/microsoftgraph/php-connect-rest-sample</a></p>
  
  <p>I have created an application and specified it want access to <code>calendar.read</code> and changed the scope in the testcode, <code>Constants::SCOPE</code>, to include this scope.</p>
  
  <p>After succesfully retrieving a token I can verify that the application requests and sets the correct privileges. After that I try to retrieve the events in my calendar as described at the documentation: <a href="https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations#get-series-master-and-single-events-rest" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations#get-series-master-and-single-events-rest</a></p>
  
  <p>I use the Advanced REST client add-on for Chrome to create a GET request with the following specs:</p>
  
  <p>Url: <code>https://outlook.office.com/api/v2.0/me/events</code>
  Headers:</p>
  
  <p><code>Authorization: Bearer [token]
  Prefer: outlook.timezone=Europe/Berlin
  </code></p>
  
  <p>The response I get is a 401 status code with the following content for the <code>X-Ms-Diagnostics</code> header:</p>
  
  <p><code>2000010;reason="ErrorCode: 'PP_E_RPS_CERT_NOT_FOUND'. Message: 'Certificate cannot be found. Certificate required for the operation cannot be found.%0d%0a Internal error: spRPSTicket-&gt;ProcessToken failed. Failed to call CRPSDataCryptImpl::UnpackData:Certificate cannot be found. Certificate required for the operation cannot be found.%0d%0a Internal error: Failed to decrypt data. :Failed to get session key. RecipientId=293577. spCache-&gt;GetCacheItem returns error.:Cert Name: (null). SKI: d6c3dacffd2b3fba2fb3d6c2b0fcd78680a3acd1...'";error_category="invalid_msa_ticket"
  </code></p>
  
  <p>The <code>Www-Authenticate</code> header specifies 'error="invalid_token"' while the token was just received.</p>
  
  <p>Any idea what I am doing wrong?</p>