title: Angular JS- Dreamfactory - Unable to connect : 403 Forbidden error
body: <p>I am on Amazon Cloud EC2 DSP 1.8.0.</p>
  
  <p>Following their docs on AngularJS this is how I am declaring my constants:-</p>
  
  <pre><code>angular.module('starter', ['ionic', 'starter.controllers', 'starter.services','**ngDreamFactory**'])
        .constant('DSP_URL', 'http://***-**-**-***-**.ap-southeast-1.compute.amazonaws.com/')
        .constant('DSP_API_KEY', 'sql')
  </code></pre>
  
  <p>The URL above is the ec2 instance address.</p>
  
  <p>This is the error I get in the console when the app starts:</p>
  
  <pre><code>- GET http://***-**-**-***-**.ap-southeast-1.compute.amazonaws.com/rest/api_docs 403 (Forbidden) 
  
  undefined : undefined http://***-**-**-***-**.ap-southeast-1.compute.amazonaws.com/rest/api_docs
  </code></pre>
  
  <p>The above error comes, even though I have not yet made any call to the DSP, so I assume it must be the framework making this call. I see this "/rest/api_docs" is getting added in the JS file added as a part of Angular SDK.</p>
  
  <p>Just to confirm that my DSP is set up correctly and my URL is correct, this is what I get when I paste this in the browser:</p>
  
  <pre><code>- http://***-**-**-***-**.ap-southeast-1.compute.amazonaws.com/rest/api_docs?app_name=sql
  
  {
    "swaggerVersion":"1.2",
    "apiVersion":"1.0",
    "authorizations":{ 
        "apiKey": {
            "type":"apiKey",
            "passAs":"header"
         }
     },
  "info": {
      "title":"DreamFactory Live API Documentation",
      "description":"",
      "contact":"support@dreamfactory.com",
      "license":"Apache 2.0",
      "licenseUrl":"http://www.apache.org/licenses/LICENSE-2.0.html"},
      "events":[ 
         "swagger.cache_cleared",
         "swagger.cache_rebuilt"
      ],
      "apis":[
         {
            "path":"/user",
            "description":"User session and profile"
         },
         {
            "path":"/system",
            "description":"System configuration"
         },
         {
            "path":"/db",
            "description":"Local database access"
         },
         {
            "path":"/email",
            "description":"Email utility access"
         },
         {
            "path":"/files",
            "description":"Local file storage access"
         },
         {
            "path":"/sql",
            "description":"Amazon RDS Sql"
         }
     ]
  }
  </code></pre>
  
  <h2>Therefore, I assume the set up is correct.</h2>
  
  <p>At the DSP end:-
  1) I have defined a role, as "Amazon RDS" and have given service access of 'sql' to this role. Also, tried giving system access. Still not working.
  2) In the CORS access inside Config, I have added * in the Host and selected all the HTTP verbs and enabled the same.
  3) Checked the "Allow Guest Users" and also Selected the role "Amazon RDS" for guest users.</p>
  
  <p>So, when I make this call later in my code:- DreamFactory.api.db.getRecords
  I get the error:</p>
  
  <pre><code>- TypeError: Cannot read property 'getRecords' of undefined
  </code></pre>
  
  <p>Because the setup service itself is not getting instantiated properly. 
  Any help in this regard would be helpful.</p>