User Registration
Last updated: March 30, 2020
If your application needs to register a user, you should first start by having the user authenticate with Meveto. After this step, Meveto will return a user ID which you can then temporarily store in either a session, in-memory storage like Redis, or even the database of your application. Upon the completion of the registration process of your choice, you can then associate the Meveto ID with the newly registered user.
Remember to
Always check that the returned Meveto User ID is not already associated with an existing user of your application. Meveto user IDs must always be unique.
Users of your application
The simplest way to configure users of your application with Meveto, is to add a column to your application's users table that will hold Meveto's unique ID for that user. For example, you can name this column meveto_id
and then add any other columns that your application needs. If needed, your users table can have both local (unique to your application) IDs which is generally an auto-incremented value along with meveto_id
. However, you are not limited to include meveto_id
inside your main users table. You can even have a separate table for Meveto IDs only, and then simply map it to your application's users. You can certainly be creative, and implement it the way that suites your needs the most.
Similarly, the above logic is true for Schema-less or also known as NoSql databases as well. All you need is an entry that can hold a You can certainly be creative, and implement it the way that suites your needstring representation of numeric value, which is the ID Meveto will return to your application.s the most. Additionally, you should also associate the following 2 attributes with the users of your application. Remember that you can add all these attributes to the same users table (entity) or create a separate table (entity) for Meveto related attributes if you want.
last_logged_in
attribute
You can call this attribute anything you want. This is the attribute that should always hold the value, of the last time a user logged in to your app using Meveto. This value should never be updated for any other logins (However, Meveto should never be used with any other login methods).
last_logged_out
attribute
Similarly, this attribute should hold the value of the last time a user logged out of your application using Meveto. Users may also be able to logout from your app directly, but that should never update this value. For information on user logout, read here.
What if your application already has users?
The configuration process remains exactly the same. If your applications already has users, you can add a meveto_id
column to your existing users table, and initialize it with a NULL
value by default for all your existing users. This way, you can safely check if a certain ID returned by Meveto does not exist in your database yet. You can ask your users to login to your application (so that you can identify which user wants to start using Meveto) using the old login method (Hopefully for the last time). After identifying the user locally, you can then update their corresponding meveto_id
from NULL
to the ID returned by Meveto.