简体   繁体   English

什么部分是定制的omniauth oauth2战略与话语整合所必需的

[英]what parts are necessary for a custom omniauth oauth2 strategy for integrating with discourse

I'm looking at using discourse which uses omniauth for authentication. 我正在使用使用omniauth进行身份验证的话语。 I need this to integrate with my current user base (where the currently auth either via email or facebook). 我需要这个与我当前的用户群(当前通过电子邮件或Facebook进行身份验证)集成。 One possiblity is to create a custom omniauth strategy (like https://github.com/intridea/omniauth-oauth2 ). 一种可能性是创建一个自定义的omniauth策略(如https://github.com/intridea/omniauth-oauth2 )。 I would be making some tweaks to the discourse code but would I need to implement my current app as Oauth2 provider? 我会对话语代码进行一些调整,但是我需要将我当前的应用程序实现为Oauth2提供程序吗? Or is there a simpler solution to this? 或者有一个更简单的解决方案吗?

I know this is a bit open-ended; 我知道这有点开放; I guess I'm looking at the easiest way to add discourse to this app and have a million other things going on right now so very focused on the fastest for what seems like a fairly simple use case. 我想我正在寻找最简单的方法来为这个应用程序添加话语,并且现在还有其他一百万个事情正在进行中,所以非常专注于最快速的看似简单的用例。

thx 谢谢

Going the OAuth2 route seems pretty reasonable. 走OAuth2路线似乎很合理。

An alternative would be to use the Omniauth Identity Strategy. 另一种方法是使用Omniauth身份识别策略。 [1] With the Omniauth Identity Strategy you could authenticate against your database by having read-only access. [1]使用Omniauth身份策略,您可以通过只读访问权限对数据库进行身份验证。 It's also possible to authenticate against an JSON API. 它也可以针对JSON API进行身份验证。 [2] [2]

[1] https://github.com/intridea/omniauth-identity [2] https://github.com/intridea/omniauth-identity#custom-auth-model [1] https://github.com/intridea/omniauth-identity [2] https://github.com/intridea/omniauth-identity#custom-auth-model

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM