带有远程会员存储的Google .NET Core身份验证 [英] .net core authentication with google with remote membership storage

查看:79
本文介绍了带有远程会员存储的Google .NET Core身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用微服务方法实现应用程序. 在我的应用程序上必须有Google登录名和基本登录名. 我有2个服务:1个用于会员服务,1个用于MVC网关.
我的会员服务已应用db和标准的asp.net核心身份.因此所有用户都存储在这里.
我的MVC网关具有登录操作,该操作需要挑战Google并获得外部登录.然后从会员服务获取一个用于此登录的用户.

I am implementing an application using microservices approach. On my application there must be Google sign-in and basic sign-in. I have 2 services: 1 for membership service and 1 for MVC gateway.
My membership service has db and standard asp.net core identity applied. So all users stored here.
My MVC gateway has login action that needs to challenge Google and get external login. And then get a user from Membership service for this login.

首先,我的想法是实现自定义IUserStore类,并从Membership Service中调用Restful Api方法.但是我在两个服务上都遇到了同步2个身份的问题.然后,我从MVC Gateway中删除了身份,但现在我无法挑战Google登录.

First my idea was to implement custom IUserStore class and call restful Api methods from Membership service. But there I faced the problem with syncing 2 Identities - on both services. Then I removed Identity from MVC Gateway, but now I cannot challenge Google Sign-in.

那么这种方法的最佳解决方案是什么?
我在MS示例中看到使用了IdentityServerr4,但我认为这对我的情况不可行.

So what is the best solution for such approach?
I saw in MS example that there was IdentityServerr4 used, but I don't think that this is viable for my situation.

推荐答案

使用IdentityServer4实现.

Implemented using IdentityServer4.

这篇关于带有远程会员存储的Google .NET Core身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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