为什么并不总是ServiceStack]连结USERAUTH和UserAuthDetails? [英] Why doesn't ServiceStack always link UserAuth and UserAuthDetails?

查看:144
本文介绍了为什么并不总是ServiceStack]连结USERAUTH和UserAuthDetails?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的东西,我还以为ServiceStack会做开箱即用的奋斗...

I am struggling with something that I would have thought ServiceStack would do "out of the box"...

我有一个ServiceStack API,允许通过的凭据,基本,谷歌OpenID和验证LinkedIn的OAuth2。

I have a ServiceStack API that allows authentication via credentials, basic, google OpenId and LinkedIn OAuth2.

空USERAUTH和UserAuthDetails表开始,我发现,如果我:

Starting with empty UserAuth and UserAuthDetails table I have found that if I:


  1. 开始我的应用,并使用凭证登录

  2. 注销

  3. 请在使用谷歌的OpenID身份验证

ServiceStack创建两个单独的USERAUTH记录,而不是链接的谷歌UserAuthDetail与证书认证USERAUTH。尽管这是两个凭证显示中均有记载相同的电子邮件地址。

ServiceStack creates two separate UserAuth records rather than linking the Google UserAuthDetail with the Credential authenticated UserAuth. This is despite the two credentials showing the same email address in both records.

但是...
如果我从一个空数据库启动和重复使用LinkedIn的OAuth2的步骤,我发现一个USERAUTH记录与链接UserAuthDetails记录创建。这就是我想要的谷歌验证的事情。

BUT... If I start from a blank database and repeat the steps using the LinkedIn OAuth2 I find that a single UserAuth record is created with a linked UserAuthDetails record. This is what I want the Google Auth to do.

任何人都可以解释为什么这种情况正在发生任何光线和我必须做,以确保谷歌验证不创建一个新的USERAUTH如果已经有一个具有匹配的电子邮件地址?

Can anyone shed any light on why this is happening and what I must do to ensure the Google Auth doesn't create a new UserAuth if there is already one with a matching email address?

推荐答案

ServiceStack合并当前认证的用户会话。即,不是由的OpenID / OAuth的提供商返回任何匹配值。

ServiceStack merges User Auth details for the current authenticated user session. i.e. not on any matching value returned by the OpenId/OAuth providers.

如果您注销,那么结束当前用户的会话并再次验证的行为就好像它是一个新的浏览器会话。

If you log out, then you end the current users session and authenticating again will behave as if it were a new browser session.

这篇关于为什么并不总是ServiceStack]连结USERAUTH和UserAuthDetails?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆