无需 DBIx 的 Catalyst 身份验证
我正在向 Catalyst 应用程序添加身份验证。该应用程序是来自另一个系统的端口,因此我必须使用当前的后台来处理某些事情。
其中之一是用户数据库。它不是 SQL,我必须通过 Web 服务访问它。
遵循 docs 现在我可以使用用户/密码的哈希值来工作,如示例所示。我还使用 DBIx 测试了 Catalyst 教程。
但现在我需要插入自己的模型来从真实的后台检查和检索用户。
在哪里?
我从控制器调用 auth 插件
$c->authenticate({ username => $username, password => $password }
在我的配置中(来自教程)
__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',
}
}
}
});
那么我在哪里可以调用我的 Web 服务模型呢?
先感谢您。
更新: 为了度过这一周,我做了自己的网络服务查询。如果结果正常,我会将获得的数据传递到这个硬编码领域。非常非常难看,但我提供了功能。现在我又认真起来了。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您必须创建自己的 auth store:
另请参阅Catalyst::Authentication::Store::Minimal
It looks like you have to create your own auth store:
Also look at Catalyst::Authentication::Store::Minimal