OpenID Connect-在WinForms和Web应用程序之间使用IdentityServer进行SSO [英] OpenID Connect - Using IdentityServer for SSO between WinForms and Web Application

查看:91
本文介绍了OpenID Connect-在WinForms和Web应用程序之间使用IdentityServer进行SSO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了Thinktecture IdentityServer,并且有两个受信任的客户端应用程序,一个WinForms应用程序和一个Web应用程序,我想在两者之间实现SSO.

I have Thinktecture IdentityServer set up and I have two trusted client applications, a WinForms app and a Web application and I want to implement SSO between them both.

用户将首先打开桌面应用程序,该应用程序具有一个通过身份服务器进行身份验证的登录页面.

The user will first open the desktop application which has a login page that authenticates with the identity server.

桌面应用程序将包含一些生成的Web链接,当单击这些链接时,会打开一个新的浏览器窗口,指向需要身份验证的Web应用程序的安全区域,但是,单击这些链接后,我不希望用户再次登录因为他们已经通过桌面应用程序进行了一次身份验证.

The desktop application will include some generated web links which when clicked open a new browser window to a secured area of the Web application that requires authentication, however, upon clicking these links I don't want the user to have to login again as they have already authenticated once via the desktop application.

我正在努力寻找哪些流程可以实现这一目标.

I'm struggling to see which of the flows can achieve this.

OpenID connect或Thinktecture IdentityServer提供了哪些机制来简化此过程?

What mechanisms, if any, are provided by OpenID connect or Thinktecture IdentityServer that can facilitate this process?

推荐答案

没有任何现成的机制,因为通过在用户代理(UA)中设置cookie来实现SSO.因此,如果用户在您的winforms应用程序的Web视图中进行了身份验证,然后启动了这样的浏览器

There aren't any out of the box mechanisms as the SSO is achieved by setting the cookies in the user agent (UA). So, if the user authenticates in a webview in your winforms app and then it launches the browser like this

System.Diagnostics.Process.Start("http://www.website.com");

为了打开Web应用程序,它显然不起作用,因为它不是相同的UA.

in order to open the web app, it won't obviously work because it's not the same UA.

尽管如此,如果您使用相同的Web视图打开Web应用程序,则可以实现此目的.

Nevertheless, if you use the same webview to open your web app you can achieve this.

这篇关于OpenID Connect-在WinForms和Web应用程序之间使用IdentityServer进行SSO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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