How do I change the user management database to my MongoDB database?
You currently can’t change the user db to a Mongo database. What you can do is use the user API in DreamFactory to mirror the user databases (go to the API Docs tab in the admin console and look at the /user API to see all the calls).
For example, you can authenticate your users in Mongo then perform a check on the DreamFactory user database. If the user does not yet exist in DreamFactory, use the API to create the user and get a session, or if the user does already exist in DreamFactory, simply auth and get a session token.
We’ll have much better plugin support for different auth schemes in version 2.0 coming out in the spring. At that point, you’ll be able to plug in OAuth 1.0, 2.0, LDAP, or use the default user management system. That will provide a lot more flexibility.
Another situation, my app has two types of users, so how do I register, authenticate and authorize these two different schemas?
If you’ve installed DreamFactory (i.e. you’re not using the free hosted system on our website), you can manually change the user schema that’s in the MySQL database. However, you currently can’t have multiple user schema…so you could create the superset of fields and have an indicator in your schema for what ‘type’ of user this is.
However, keep in mind that DreamFactory supports any number of roles (each user is associated with one role and you can have dozens or even hundreds of different roles for different types of users). Roles govern backend permissions on everything…APIs, data tables, record sets, etc. So typically there’s a single user schema and each user has a role that controls what he or she can and can’t do.