# User registration, authentication and authorization in a different database

**URL:** <https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716>\
**Category:** Users & Roles\
**Created:** [December 30, 2014, 3:13am UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716 "2014-12-30T03:13:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![edusantana](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/edusantana/32/194_2.png) [@edusantana](https://community.dreamfactory.com/u/edusantana)\
**Post date:** [December 30, 2014, 3:13am UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/1 "2014-12-30T03:13:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![benbusse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/benbusse/32/4_2.png) [@benbusse](https://community.dreamfactory.com/u/benbusse)\
**Post date:** [December 30, 2014, 3:34pm UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/2 "2014-12-30T15:34:24Z")

</div>

> > 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.

---

<div class="post-metadata">

**Author:** ![MTAdam36](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mtadam36/32/226_2.png) [@MTAdam36](https://community.dreamfactory.com/u/MTAdam36)\
**Post date:** [February 6, 2015, 6:43pm UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/3 "2015-02-06T18:43:31Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![benbusse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/benbusse/32/4_2.png) [@benbusse](https://community.dreamfactory.com/u/benbusse)\
**Post date:** [February 6, 2015, 6:56pm UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/4 "2015-02-06T18:56:28Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![MTAdam36](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mtadam36/32/226_2.png) [@MTAdam36](https://community.dreamfactory.com/u/MTAdam36)\
**Post date:** [February 6, 2015, 7:42pm UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/5 "2015-02-06T19:42:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![benbusse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/benbusse/32/4_2.png) [@benbusse](https://community.dreamfactory.com/u/benbusse)\
**Post date:** [February 6, 2015, 7:54pm UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/6 "2015-02-06T19:54:49Z")

</div>

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 😄

---

<div class="post-metadata">

**Author:** ![PBAdmin](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@PBAdmin](https://community.dreamfactory.com/u/PBAdmin)\
**Post date:** [April 26, 2015, 2:14pm UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/7 "2015-04-26T14:14:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![benbusse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/benbusse/32/4_2.png) [@benbusse](https://community.dreamfactory.com/u/benbusse)\
**Post date:** [April 27, 2015, 10:34pm UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/8 "2015-04-27T22:34:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PBAdmin](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@PBAdmin](https://community.dreamfactory.com/u/PBAdmin)\
**Post date:** [April 28, 2015, 4:10am UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/9 "2015-04-28T04:10:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![benbusse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/benbusse/32/4_2.png) [@benbusse](https://community.dreamfactory.com/u/benbusse)\
**Post date:** [April 29, 2015, 6:53pm UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/10 "2015-04-29T18:53:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Im\_PJ](https://avatars.discourse-cdn.com/v4/letter/i/59ef9b/32.png) [@Im\_PJ](https://community.dreamfactory.com/u/Im_PJ)\
**Post date:** [July 11, 2015, 4:56am UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/11 "2015-07-11T04:56:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![benbusse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/benbusse/32/4_2.png) [@benbusse](https://community.dreamfactory.com/u/benbusse)\
**Post date:** [July 11, 2015, 5:08am UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/12 "2015-07-11T05:08:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DFCommunityManager](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/dfcommunitymanager/32/887_2.png) [@DFCommunityManager](https://community.dreamfactory.com/u/DFCommunityManager)\
**Post date:** [May 12, 2016, 8:55pm UTC](https://community.dreamfactory.com/t/user-registration-authentication-and-authorization-in-a-different-database/716/13 "2016-05-12T20:55:38Z")

</div>

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.](https://blog.dreamfactory.com/dreamfactory-2-1-2-release) You can now [download it here.](https://www.dreamfactory.com/downloads)

I would love to hear how it goes.

Thank you for your patience.

- @AlexBowen
