Headless Drupal 8 – REST API 401 Unauthorized in user register json post

I created a headless application using Drupal and Vue.js/Nuxt.js. I want anonymous users to register and Admin approves their subscription (the configuration for this is done).

I can’t find a way to understand why:

When I activate “Access POST on User registration resource” permission for anonymous users I got 401 Unauthorized status with the message “No authentication credentials provided.” using Postman or Axios.

and

When I activate “Administer users” permission for Anonymous users, the POST method works fine for me without the X-CSRF-Token in the header.

The anonymous users don’t need any identification methods to access the registration form and send their information using /user/register?_format=hal_json.

“Administer users” permission (Warning: Give to trusted roles only) will let any user display, edit, delete users using the server url.


let userData = {
        "_links": {
          "type": {
            "href": "http://example.com/rest/type/user/user"
          }
        },
        "name": ({"value": "jack"}),
        "mail": ({"value": "jack@yopmail.com"}),
        "field_phone": ({"value": "99999999"}),
        "roles": ({"target_id": "member"}),
        //"pass": ({"value": "0000"}) // if required email verification (admin/config/people/accounts) not checked we send pass
      };

 // Post Data
      this.$axios.post("http://example.com/user/register?_format=hal_json", userData, {
        headers: {
          "Content-type": "application/hal+json"
        }
      }).then(() => {
      }).catch(function (res) {
      });

I also tried to Uncheck the “Administer users” permission for Anonymous user and added the “X-CSRF-Token” with a value from “www.example.com/session/token” in the headers but I still get the {“message”:”No authentication credentials provided.”}

User registration config:
enter image description here
Account Config:
enter image description here
Administer users permission:
enter image description here
Access POST on User registration resource:
enter image description here