title: 401-Unauthorized when calling UmbracoAuthorizedApiController from backoffice
body: <h2>Problem</h2>
  
  <p>When I change my controller to <strong>inherit from UmbracoAuthorizedApiController instead of UmbracoApiController</strong> I will get 401-Unauthorized and I will be redirected to loging page.</p>
  
  <h2>Mode Details</h2>
  
  <p>I want to call some of my backend Api's from the back-office and to do that I've followed the article <a href="https://our.umbraco.org/documentation/Implementation/Controllers/" rel="nofollow noreferrer">in our.umbraco</a>.</p>
  
  <p>First I've implemented a controller inheriting from UmbracoApiController to be able to call my services from postman. Everything went fine and I could call my code and read data from Umbraco:</p>
  
  <pre><code> [RoutePrefix("api/admins")]
   public class AdminsController : UmbracoApiController
   {
        [HttpGet]
          [Route("getdata")]
          public DataViewModel GetData(string id)
          {
            ....
           } 
   }
  </code></pre>
  
  <p>Then I've called my service from JavaScript in Dashboard using the plugins</p>
  
  <pre><code>  $http.get(vm.baseUrl + '/getdata?id=' + id, {})
              .then(function (response) {....}
  </code></pre>
  
  <p>Everything works fine, I can see that my cookies (containing token) has been sent in the request headers.</p>
  
  <p><a href="https://i.stack.imgur.com/X5a6j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X5a6j.png" alt="token in request"></a> </p>
  
  <p>Then I've updated my controller to inherit from <strong>UmbracoAuthorizedApiController</strong> and now I don't have access to my Apis.</p>
  
  <p>The controller is now like this:</p>
  
  <pre><code>   [RoutePrefix("api/admins")]
      public class AdminsController : UmbracoAuthorizedApiController
  </code></pre>
  
  <p>What did I do wrong?</p>