WP REST User

설명

If you wish to ‘Register User’ or ‘Retrieve Password’ using REST API, without exposing Administrator credentials to the Front End application, you are at the right place. Since WordPress 4.7, REST API was natively included in WordPress.

In order to ‘Register User’ or ‘Retrieve Password’, the authentication for a user with ‘Administrator’ role is required. While this is a delibrately done for security reasons, such implementation makes it very hard for Front End applications to implement a simple ‘Register’ or ‘Sign Up’ function.

This plugin fullfills such requirement by extending the existing WordPress REST API endpoints.

Usage

Register a User

To Register a User using REST API, send a POST request to /wp-json/wp/v2/users/register, with a JSON body (Set header: content-type: application/json):

{
    "username": "your-username",
    "email": "username@test.com",
    "password": "0000",
}

If successful, you should receive the following response

{
    "code": 200,
    "id": 13,
    "message": "User 'your-username' Registration was Successful"
}

To perform further actions after user is registered, write and add_action:

add_action('wp_rest_user_user_register', 'user_registered');
function user_registered($user) {
    // Do Something
}

Reset Password

To Retrieve Password using REST API, send a POST request to “/wp-json/wp/v2/users/lost-password`, including a JSON body (Set header: content-type: application/json):

{
    "user_login": "username@test.com"
}


user_login can be either user's username or email.

If successful, you should receive the following response

{
    "code": 200,
    "message": "Reset Password link has been sent to your email."
}

See the Screenshot below for POSTMAN demo:

Technical Support

SK8Tech – Customer Success Specialist offers Technical Support to configure or install WP REST User.

Our Services

Contact Us

Based in Sydney, SK8Tech is a innovative company providing IT services to SMEs, including Web Design, App Development and more.

스크린샷

설치

  1. Upload wp-rest-user folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

FAQ

Why do I need WP REST User?

If you’re planning on using your WordPress website as a Backend, and you’re consuming RESTful api, you’ll most probably need to Register User via REST API. This is precisely what this plugin does.

Is it secure?

Great question! For the time being, this plugin only allows registering user as ‘subscriber’ or ‘contributor’ role. ‘Subscriber’ role has very limited capability in terms what WordPress allows him/her to do. From our perspective, subscribers are quite harmless.

Does it work with WooCommerce?

Another great question! By default, WordPress registers new user as ‘subscriber’, while WooCommerce registers new user as ‘customer’.
If you have WooCommerce installed and activated on your WordPress website, this plugin will automatically register user as ‘customer’ as well.

There’s a bug, what do I do?

Please create a ticket on the support forum. We’ll get back to you ASAP.

후기

2019년 November 20일
Very nice, can use it very easy with your documentation. Thanks you
2019년 September 12일
this plugin is awesome i was looking for autorization to access the rest api it works very well and it's simple too congrats !
모든 3 평가 읽기

기여자 & 개발자

“WP REST User”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

“WP REST User”(이)가 1(으)로 번역되었습니다. 기여해 주셔서 번역자님께 감사드립니다.

자국어로 “WP REST User”(을)를 번역하십시오.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하십시오.

변경이력

1.4.3

  • Tested up to WordPress 5.5
  • Added id to register user response.
  • Updated README
  • Bug fixes

1.4.2

  • Fixed README.md
  • Security Fix

1.4.1

  • Added an action hook when user is registered.

1.3.0

  • Added an end point for retrieve password email.

1.2.1

  • Changed success status code from 123 to 200

1.2.0

  • Now supports more roles, including
    1. subscriber
    2. customer
    3. contributor
    4. custom roles

1.1.0

  • Now supports ‘Customer’ role to be registered, if WooCommerce plugin is installed
  • Restructured Plugin for future development.

1.0.1

  • Initial Release.
  • Only user with ‘Subscriber’ role can be created.
  • Only ‘username’, ’email’, ‘password’ fields are accepted.