A Node JS REST API Demo for Azure Active Directory (AD) B2C Custom Policy. Claims exchange through body only. This API is protected with Basic AUTH.
$ npm install && npm update
$ node app.js
http://localhost/signup
Basic AUTH Credentials:
- Client ID: B2cRestClientId
- Client Secret: admin
{
"email": "[email protected]",
"password": "2222",
"firstName": "John",
"lastName": "Smith"
}
Please note, that if password = 1234, a claim validation error will be thrown. Claim validation is handled at the endpoint.
- Success:
{
"status": "1"
}
- Errors (Missing Claims):
{
"errors": [
"firstName is not defined!",
"lastName is not defined!"
]
}
- Validation Errors (When password: '1234')
{
"errors": [
"password is too simple!"
]
}