0

I am adding authentication to my Catalyst application. The app is a port from another system, so I must use the current backoffice for some things.

One of those things is the users database. Its not SQL and I must access it trough web services.

Following docs now I have it working using hashes for user/password, as in the example. I also tested the Catalyst tutorial using DBIx.

But now I need to plug my own model to check and retrieve the user from the real backoffice.

Where?

From the controller I call the auth plugin

$c->authenticate({ username => $username, password => $password  }

And in the config I have (from the tutorial)

 __PACKAGE__->config('Plugin::Authentication' => {
    default_realm => 'members',
    realms => {
        members => {
            credential => {
                class => 'Password',
                password_field => 'password',
                password_type => 'clear'
            },
            store => {
                class => 'DBIx::Class',
                user_model => 'MyApp::User',
                role_relation => 'roles',
                role_field => 'rolename',
            }
        }
    }
});

So where can I call my web services model?

Thank you in advance.

UPDATE: To survive the week I maed my own webservices query. If the result is OK I pass the obtained data to this hardcoded realm. Very, very, very ugly, but I delivered the functionality. Now I am serious again.

Community
  • 1
  • 1
Nacho B
  • 1,573
  • 1
  • 12
  • 16

1 Answers1

1

It looks like you have to create your own auth store:

store => {
  class => '+MyApp::Authentication::Store::NetAuth',
  authserver => '192.168.10.17'
}

Also look at Catalyst::Authentication::Store::Minimal

Brad Gilbert
  • 33,846
  • 11
  • 78
  • 129
Cornel Ghiban
  • 902
  • 4
  • 6
  • Thanks. My auth data comes from "web services", but its not a preexistent "web service" that I can access trough an IP. I can query the remote server using SOAP::Lite, sending user and password, and it returns data from the user. I do not know how or where to send the retrieved data inside Authorization. – Nacho B Jan 24 '12 at 12:06