Authenticate User against different Database

A place for users and developers of the Xataface to discuss and receive support.

Authenticate User against different Database

Postby JGerrity » Fri Mar 02, 2012 4:49 pm

Hello,

I've read the posts and docs about authentication but can't seem to find something applicable.

When a user logs in (I'm actually using the WebAuction app), I would like the authentication to happen against a different DB than that of the WebAuction App. I know it makes more sense to use the same DB and WebAuction has it's own tables for users, etc.. however, our site admin has already setup a DB for user authentication and I'd like to authenticate against that. So, the webauction app would actually be using two databases...would it make more sense to pass the loing portion over to a different app and then pass back a value to indicate authenticated or not...(logged in to bid).

Thank you,
Jason
JGerrity
 
Posts: 16
Joined: Fri Mar 02, 2012 4:43 pm

Re: Authenticate User against different Database

Postby shannah » Fri Mar 02, 2012 6:12 pm

If the db is on the same server and dbms, you could just create a view to the target database and use that view as your users table.
e.g.
Code: Select all
create view users as select * from otherdb.users
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Authenticate User against different Database

Postby JGerrity » Sat Mar 03, 2012 7:49 am

Hi Steve,

Thanks for the quick reply.

My mistake in not stating that I'm a complete noob when it comes to coding.... could you please translate your response into english ? ;)

Where am I creating this view and putting that code?

Cheers,
J.
JGerrity
 
Posts: 16
Joined: Fri Mar 02, 2012 4:43 pm

Re: Authenticate User against different Database

Postby ADobkin » Sat Mar 03, 2012 2:36 pm

I've never tried this, but based on Steve's response, I would create a view in the MySQL database that contains your application tables. You would do this either using the MySQL command line (if you are familiar with it) or a GUI such as phpMyAdmin or MySQL Workbench.

Once the view has been created, you would specify this view name (called "users" in Steve's example) in the conf.ini folder as your new users table, e.g.:

Code: Select all
[_auth]
users_table = "users"
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA

Re: Authenticate User against different Database

Postby JGerrity » Wed Mar 14, 2012 5:47 am

Just wanted to say thank you for the response.

It worked!

Regards,
J.
JGerrity
 
Posts: 16
Joined: Fri Mar 02, 2012 4:43 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 14 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved