User registration, authentication and authorization in a different database

DreamFactory uses MySQL as its default database. My app uses MongoDB.

How do I change the user management database to my MongoDB database?

Another situation, my app has two types of users, so how do I register, authenticate and authorize these two different schemas?

1 Like

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.

2 Likes

@benbusse I am really looking forward to the LDAP authentication. That is the one element that is preventing me from completing my current project. Is there any firmer time frame for the 2.0 release yet? March, April, or May?

@MTAdam36 we’re shooting for an alpha 2.0 release at the end of March, followed closely by a beta 2.0 candidate in April. 2.0 should be production-ready in Q2, shooting for May.

1 Like

will the 2.0 alpha and beta be available on the dreamfactory github repository for testing?

Yes, as soon as we have a usable 2.0 alpha, it’ll be up on GitHub for anyone in the world to bang on :smile:

Hello @benbusse,

I have no questions here for related topics

If i’m using user management database on Dreamfactory console, would I be able to port the user data to dynamodb when dreamfactory 2.0 arrive? How hard would it be to use OAuth 2.0 with LDAP or LDAP by itself with dynamnodb?

As for keeping the app signed-in after user login (similar to facebook app), would it be hard to do with LDAP?

Also when will dreamfactory 2.0 be out or is alpha already started?

Thank you very much and I’m still relative new to this.

2.0 will let you select any SQL database to store user and role data (currently user and role data is stored in MySQL only). 2.0 will also make it easy to authenticate users with OAuth and Active Directory. Permanent login (i.e. no session timeout) will also be supported in 2.0.

So you won’t have to use LDAP for any of the features above. It’s all built into the 2.0 platform. Why do you need to port the user data to DynamoDB?

We’re a little behind, but 2.0 code should be public on GitHub in a couple of weeks.

Dear @benbusse

Is it possible to have alternative database to host user login and role information instead of default SQL and simply auth at dreamfactory to get session token? thanks

check users information at mongo/dynamodb -> auth at dreamfactory and give session token -> able to access the respect services or something along the line

Ivan

This will be possible in 2.0, either out of the box with a separate package for Auth, or via scripting. OAuth would be easiest, but overriding our config to use a different database shouldn’t be terribly difficult.

I’m currently in process of implementing mobile app for small organisation using dreamfactory api. I really need a way to authenticate users with my own existing sql db. As per this thread, its not supported currently. So when will DSP 2.0 arrive? I’m still running v1.9
pls let me know. Many thanks for DSP.

Shooting for July 31 on 2.0 beta. We’re close, hold tight.

1 Like

Hey @Im_PJ, @MTAdam36, @PBAdmin - I wanted to give you an update!

We have officially release DreamFactory 2.0! We are actually now on 2.1.2. See our latest blog post here. You can now download it here.

I would love to hear how it goes.

Thank you for your patience.

  • @AlexBowen