doufu7464 2016-10-13 04:27
浏览 143

从PHP系统通过Odoo中的XMLRPC进行身份验证

I would like to authenticate into Odoo via xmlrpc but as a SSO kind of implementation. The credentials of the users will be the same in both Odoo and PHP, so basically there will be a redirection to Odoo from the php system when the user is logged in there. The thing is since the passwords are hashed at both the PHP and Odoo side, there is no way to pass the password from php to odoo. I know that authentication can be done if the username and password is passed, but this isnt the case here, so is there any way to implement an SSO for the above scenario?

Thanks And Regards,

Yaseen Shareef

  • 写回答

1条回答 默认 最新

  • doudi7570 2016-10-13 07:09
    关注

    Odoo supports other authentication mechanisms than local passwords, out-of-the-box:

    • LDAP authentication is provided by the built-in auth_ldap module. It requires an external LDAP service, such as openldap or a Microsoft Active Directory. It works at the XML-RPC level as well, because it is a password-based mechanism.
    • OAuth2 authentication is provided by the built-in auth_oauth module. It requires an external OAuth2 provider, such as Google or Facebook accounts. This does not work transparently at the XML-RPC level, because it is not strictly password-based. You need to do the OAuth authentication of an HTTP session first, and then you can use the JSON-RPC API to remotely access Odoo as you would with XML-RPC.
    • Odoo 8 also includes built-in support for OpenID integration, via the auth_openid module. This requires an external OpenID service, but has been deprecated as of Odoo 9 in favor of the equivalent OAuth services. Similarly to OAuth, it is not password-based so it will not work at the XML-RPC level directly.

    The Odoo API is fully accessible through either XML-RPC or JSON-RPC, these are strictly equivalent. There are RPC libraries for each in most languages, and popular languages often have dedicated Odoo RPC libraries.

    You can easily achieve SSO on Odoo and your PHP application by using one of these external authentication mechanisms, as there are PHP libraries for each of them. You just need to choose a suitable provider for your case.

    In addition third-party community modules exist for other authentication mechanism (look here for starters). For example, for version 7.0 there was a module that would authenticate in Odoo based on the HTTP Basic authentication (auth_from_http_basic), allowing for SSO based on the web server' pluggable authentication. I don't think it was ported for version 8, but you can perhaps contact the authors and help get it done.

    评论

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算