Post User Registration Action - Module Not Found

Thanks. I was able to solve my issue using the tutorial you provided: How can I use the Management API in Actions?

However, I want to point out that on step 2, it says “2. Authorize it to use the Management API with the required scopes:” and only shows the need for the update:roles permission. When providing this permission alone, it did not work:

{
  "action_name": "Assign Role On First Login",
  "response": {
    "logs": "Forbidden: Insufficient scope, expected any of: read:roles,update:users,create:role_members\n    at /data/layers/layers-NCEn/NCEnN1oWAIpnwGrXpY_KwQ87kXoeGbwCOW9Qt4Ssh0M/node_modules/rest-facade/src/Client.js:402:25\n    at Request.callback (/data/layers/laye",
    "stats": {
      "total_request_duration_ms": 1017,
      "total_runtime_execution_duration_ms": 1013,
      "runtime_processing_duration_ms": 5,
      "action_duration_ms": 1008,
      "boot_duration_ms": 5,
      "network_duration_ms": 4
    }
  },
  "started_at": "2023-07-15T13:11:04.503739087Z",
  "ended_at": "2023-07-15T13:11:05.521390576Z"
}

I also added the read:roles permission and it worked, though I assume adding any of the roles specified would do the trick read:roles,update:users,create:role_members

Just wanted to point this out. Maybe you could have someone update that blog post. Thanks.

1 Like