title: How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API
body: <p>I have implemented an Azure AD OAuth2 Daemon or Server to ASP.NET Web API.
  However I only receive an access token which is the property on the AuthenticationResult. See implementation below.</p>
  
  <pre><code>    public IHttpActionResult GetAccessToken(string clientId, string clientkey)
      {
          AuthenticationContext authContext = new AuthenticationContext(authority);
          ClientCredential clientCredential = new ClientCredential(clientId, clientkey);
          AuthenticationResult authenticationResult = authContext.AcquireTokenAsync(resourceUri, clientCredential).Result;
          Authorisation authorisation = new Authorisation {access_token = authenticationResult.AccessToken,
                                                  token_type = authenticationResult.AccessTokenType,
                                                  expires_on = authenticationResult.ExpiresOn };
  
          return Ok(authorisation);
      }   
  </code></pre>
  
  <p>This returns only access token. I would like an implementation, a Daemon or Server implementation that returns both access token and refresh token. Have your seen or done similar implementation. Any useful links to an example are welcome.</p>