# Error creating "shadow" customer with two-legged authentication

**URL:** <https://community.particle.io/t/error-creating-shadow-customer-with-two-legged-authentication/33426>\
**Category:** Troubleshooting\
**Created:** [June 1, 2017, 4:06am UTC](https://community.particle.io/t/error-creating-shadow-customer-with-two-legged-authentication/33426 "2017-06-01T04:06:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpk788](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@rpk788](https://community.particle.io/u/rpk788)\
**Post date:** [June 1, 2017, 4:06am UTC](https://community.particle.io/t/error-creating-shadow-customer-with-two-legged-authentication/33426/1 "2017-06-01T04:06:13Z")

</div>

Hi, what I am currently trying to do is create a new shadow customer in the Particle system. So far I created a product in the dashboard as well as an oAuth client that has the create customer scope. When I tried to make a request to the following endpoint:

```
https://api.particle.io/v1/products/:productID/customers

```

I get the following error:

```
{
   "code" : 400,
   "error" : {
      "code" : 503,
      "message" : "No valid scopes",
      "headers" : {
         "Pragma" : "no-cache",
         "Cache-Control" : "no-store"
      },
      "error_description" : "server_error",
      "stack" : "Error: No valid scopes\n at OAuth2ServerModel.saveAccessToken (/opt/particle-base/api_service/releases/b8eebe48646483604720ac88fb71e61d7e7e5655/lib/OAuth2ServerModel.js:117:19)\n at Grant.saveAccessToken (/opt/particle-base/api_service/shared/vendor/node_modules/oauth2-server/lib/grant.js:421:14)\n at run (/opt/particle-base/api_service/shared/vendor/node_modules/oauth2-server/lib/runner.js:15:14)\n at /opt/particle-base/api_service/shared/vendor/node_modules/oauth2-server/lib/runner.js:17:7\n at /opt/particle-base/api_service/shared/vendor/node_modules/oauth2-server/lib/grant.js:396:3\n at OAuth2ServerModel.generateExpiresTime (/opt/particle-base/api_service/releases/b8eebe48646483604720ac88fb71e61d7e7e5655/lib/OAuth2ServerModel.js:232:3)\n at Grant.generateExpiresTime (/opt/particle-base/api_service/shared/vendor/node_modules/oauth2-server/lib/grant.js:388:13)\n at run (/opt/particle-base/api_service/shared/vendor/node_modules/oauth2-server/lib/runner.js:15:14)\n at /opt/particle-base/api_service/shared/vendor/node_modules/oauth2-server/lib/runner.js:17:7\n at /opt/particle-base/api_service/shared/vendor/node_modules/oauth2-server/lib/grant.js:376:5\n at InternalFieldObject.ondone (/opt/particle-base/api_service/shared/vendor/node_modules/oauth2-server/lib/token.js:55:5)",
      "error" : "server_error",
      "name" : "OAuth2Error"
   },
   "ok" : false
}

```

I am including the no\_password=true, and the user’s email in the body of the POST request and setting the Content-Type header to “application/x-www-form-urlencoded”. To make the situation even more complicated, when I try to make the request again I get the following error:

```
{"ok":false,"code":400,"error":"customer_exists"}

```

which leads me to believe the user was actually created partially during the first request. This customer is not showing up under my product in the Particle dashboard though. If anyone has any tips for how to resolve this and can point out what was wrong with the original request that would be very helpful. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![rpk788](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@rpk788](https://community.particle.io/u/rpk788)\
**Post date:** [June 5, 2017, 2:47am UTC](https://community.particle.io/t/error-creating-shadow-customer-with-two-legged-authentication/33426/2 "2017-06-05T02:47:07Z")

</div>

Seems to be a duplicate of this post:

> [@2 leg auth, Create customer Failing kind of](https://community.particle.io/t/2-leg-auth-create-customer-failing-kind-of/18299):
>
> Hey, There I’ve Been try to get the 2 leg auth to work. mostly just create a customer also i’ve already review the [post](https://community.particle.io/t/creating-a-new-customer-two-legged-auth-now-working/14825) similar to this but, find i’m still having problems. I’ve area gone through the process of making a client. Currently what i’m submitting is the following. curl -u "b\*\*\*\*\*alpha-v02-4\*\*\*\*:9a\*\*\*\*\*\*\*\*\*5" -d email=testCustomer012@testEmail.com -d no\_password=true https://api.particle.io/v1/orgs/fakeorgslug/customers I’ve also try doing versions where I’ve pass the my access tok…
