Skip to Content
2
Sep 18, 2020 at 07:12 AM

Inconsistency in CAP Documentation Page Authentication

102 Views Last edit Sep 18, 2020 at 07:52 AM 2 rev

Hi Iwona Hahn,

on the CAP Documentation Page Authentication - Mocked Authentication - Default Configuration this standard configuration is shown:

cds.requires.auth = {
  strategy: "mock",
  users: {
    "alice": { "roles": ["admin"] },
    "bob": { "roles": ["builder"] },
    "*": true //> all other logins are allowed as well
  }
}

In the next section "Configuring Specific Users" shows this example:

"cds": { // in case of package.json
  "requires": {
    "strategy": "mock",
    "auth": {
      "users": {
        "<user.id>": { 
          "password": "<password>", 
          "roles": ["<role-name>", ...],
          "userAttributes": { ... }
        },
      }
    }
  }
}

I think it must be corrected to:

"cds": { // in case of package.json
  "requires": {
    "auth": {
      "strategy": "mock",
      "users": {
        "<user.id>": { 
          "password": "<password>", 
          "roles": ["<role-name>", ...],
          "userAttributes": { ... }
        },
      }
    }
  }
}

Best regards
Gregor