title: How to use IdentityServer4 scopes in resource api
body: <p>I am creating an api resource in my identityserver application:</p>
  
  <pre><code>new ApiResource
  {
      Name = "socialnetwork",
  
      Scopes =
      {
          new Scope()
          {
              Name = "socialnetwork.read_contents",
              DisplayName = "Read"
          },
          new Scope
          {
              Name = "socialnetwork.share_content",
              DisplayName = "Write"
          }
      }
  }
  </code></pre>
  
  <p>But how can I use this scopes in my socialnetwork api controllers. </p>
  
  <pre><code>public class SocialController : Controller
  {
     [HttpGet]
     public async Task&lt;IActionResult&gt; GetCotntents(){
  
     }
  
     [HttpPost]       
     public async Task&lt;IActionResult&gt; ShareCotntents(string content){
  
     }
  }
  </code></pre>
  
  <ul>
  <li>If a client has <code>socialnetwork.read_contents</code> scope, it can access <code>GetCotntents()</code> method.</li>
  <li>If a client has <code>socialnetwork.share_content</code> scope, it can access <code>ShareCotntents()</code> method.</li>
  </ul>
  
  <p>Actually does scope purpose is this? And how can I use it?</p>