title: Get Refresh Token Outlook REST API OAuth PHP
body: <p>I completed the PHP tutorial <a href="https://dev.outlook.com/RestGettingStarted/Tutorial/php" rel="nofollow">https://dev.outlook.com/RestGettingStarted/Tutorial/php</a>
  Finished the whole Rest API documentation <a href="https://msdn.microsoft.com/en-us/office/office365/api/contacts-rest-operations" rel="nofollow">https://msdn.microsoft.com/en-us/office/office365/api/contacts-rest-operations</a>
  Have everything working but connection is lost after 60 minutes.
  I need a refresh token to get a new access token. But i have never received a refresh token and can't get it. 
  Looked over the internet for general OAuth documentation and questions of this forum.</p>
  
  <p>Tried all kind of solutions, nothing works. </p>
  
  <pre><code>    $token_request_data = array(
          "grant_type" =&gt; "authorization_code",
          'always_issue_new_refresh_token' =&gt; true,
          'refresh_token_lifetime'         =&gt; 2419200,
          'approval_prompt'=&gt;'force',
          'access_type'=&gt;'offline',
          'prompt'=&gt;'consent',
          'approval_prompt'=&gt;'force',
          "code" =&gt; $authCode,
          "redirect_uri" =&gt; self::$redirectUri,
          "scope" =&gt; implode(" ", self::$scopes),
          "client_id" =&gt; self::$clientId,
          "client_secret" =&gt; self::$clientSecret
      );
  </code></pre>
  
  <p>It is told that the refresh token is only send after first sign up for the app.</p>
  
  <p>So I created a complete new app and signed in. But no refresh token in the replied JSON data.</p>
  
  <p>It seems impossible to get a refresh token. </p>
  
  <p>Does anyone succeeded in doing so? How?</p>