Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7709481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:52:24+00:00 2026-06-01T00:52:24+00:00

Just for organization sake, I wanted to use a different table for the authentication

  • 0

Just for organization sake, I wanted to use a different table for the authentication component to check, but it doesn’t quite work. While I can initially state:

$this->Auth->userModel = "CoreUsers" plus set the loginAction to my proper MVC
works to look at that table just to confirm it’s there, but the login doesn’t work, it only keeps returning an incorrect password. Something happens in the authentication component; I can’t tell what makes it fail. When I rename my table to “Users”, it works.

The other part is I’d prefer to actually use the column name of ’email’ rather than ‘username’ since that’s really what I’m using anyway.

I am just not having luck finding a complete tutorial and reference sets to do both these successfully with CakePHP 2.x. What is the way forward?

References:

  1. Stack Overflow question How do I use a table other than “Users” for CakePHP’s AuthComponent?

  2. Stack Overflow question CakePHP – ‘AuthComponent’ with a different model name (not ‘User’)

(I had a look for answers, but I never quite got the whole answer.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:52:26+00:00Added an answer on June 1, 2026 at 12:52 am

    Make sure your database table “core_users” and model “CoreUser” exists.

    When you setup component you can put login/logout redirect here.

    var $components = array(
            "Auth" => array(
                 'loginRedirect' => array('controller' => 'dashboard', 'action' => 'index'),
                 'logoutRedirect' => array('controller' => 'core_users', 'action' => 'login')
                  ),
           "Session");
    

    Now in beforeFilter medhod you can put the following

    function beforeFilter(){
          $this->Auth->authenticate = array(
             AuthComponent::ALL => array('userModel' => 'CoreUser', 'scope' => array("CoreUser.status" => 1), "fields" => array("username" => "email", "password" => "your_password_field"), 'Form', 'Basic'
                                            );
    }
    

    Above example you can ignore status, if you need to pass any other info on the login verification u can use that. Now about you can remove ‘Basic’ if you only need form validation.
    I hope this would work .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my organization, we are just beginning to use the Entity Framework for some
I work for a large organization that supports many different sites on a nation
I am just attempting to use the java keytool but I cannot figure out
I was just reading this article and it mentions that some organization had an
I've just started programming in Assembly for my computer organization course, and I keep
I just migrated my server's photos to an S3. Everything seems to work swimmingly
There is quite a tier of organization in Eclipse. You can have multiple workspaces,
This question goes beoynd just programming, but I'd like to get some input on
I am investigating the use of Entity Framework in my organization. We use Oracle
The organization I currently work for uses SVN for developing PHP applications. Our development

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.