BadgeOS User API Design

Steps

User Creation

Generally, this will be happening within the context of assembling a Team (INV-01 Create Team)

  • From the WordPress "Back-End", enter the required information for the User.
  • From the Invitation App (or UserAdmin module), Find the users within WordPress/BadgeOS that are not present in ClueRide Member table and update Member table as needed. Haven't thought through the scheduling for this: trigger, polling, sync/async.
  • As the team is assembled (this might be a good trigger):
    • Verify presence in both tables

DB Concerns

  • Writing a record to the wp_user table works, but it is a partial implementation.
  • Still need to enter the UAM records.
  • Still need to assign a Role that matches the UAM records.

References for DB Work

Database Reverse Engineering

Much of the data shows up in the wp_usermeta table. This spreadsheet covers how we're approaching this: https://docs.google.com/spreadsheets/d/1glwE_BQ36XwMFQXKjov-W2oC9wgGBUA6kHNfiqfdWAM/edit?usp=sharing

Exploring Form-Submission and WP REST API (FUTURE)

Need to figure out how to authenticate.

  • Session Cookie is the preferred and only native method. The cookies are set upon login and then remain as part of the session. I would need to explore how to do this in both Postman, Java, and BDD/Python.
  • Alternates are available via plugin:
    • I had installed JWT Authentication for WP-API (v1.2.4), but haven't dug into it (it was disabled)

Here's the thing:

  • Neither the API or the JWT are being kept up-to-date.
  • Neither has been tested since WP 4.7 or so.
  • The APIs won't support a few back-end pieces I'll need to go to the database for anyway:
    • Badge-specific posts
    • Badge-specific records
    • UAM module

For these reasons, I think sticking with either a) Form Submission or b) Database approach is best.

Here's some (minimal?) JSON for creating a new user.

    {
        "name": "User Name 5",
        "email": "uname5@clueride.com",
        "username": "uname5",
        "password": "random-stuff",
        "url": "https://clueride.com/",
        "description": "Don't need no stinking description; but where does this show up?",
        "link": "https://clueride.com/author/uname5/",
        "slug": "uname5"
    }

References

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License