如何在会话配置dotNetOpenId少负载均衡环境 [英] How to configure dotNetOpenId in an session less load balancing environment

查看:198
本文介绍了如何在会话配置dotNetOpenId少负载均衡环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您以前可能解决了这个。

You've probably solved this before.

我需要能够使用开放的id在不具有会话粘性的环境。这些服务器做preserve头。

I need to be able to use open id in an environment that does not have session stickiness. The servers do preserve the headers.

我使用ASP.NET MVC和dotNetOpenId版本3.2.0.9177。虽然返回响应当上了第三方网站身份验证的推移顺利,我得到一个错误,认证失败。

I'm using ASP.NET MVC and dotNetOpenId version 3.2.0.9177. Although the authentication on the 3rd party web site goes without a hitch when returning the response I get an error and authentication fails.

有什么想法?

推荐答案

状态

最优化的方法是编写自定义持久性存储实现 IRelyingPartyApplicationStore 为机密的OpenID的RP的需要,以及您的实例传递给 OpenIdRelyingParty(IRelyingPartyApplicationStore)的构造函数,或在您的注册它web.config文件

The most optimized method is to write a custom persistence store that implements IRelyingPartyApplicationStore for the "secrets" that OpenID RPs require, and pass your instance to the OpenIdRelyingParty(IRelyingPartyApplicationStore) constructor, or register it in your web.config file.

无国籍

一个更容易的解决方案,能够满足大多数情况下是使用无状态模式替代,这样就没有国家需要能够在整个Web场的服务器共享。

A much easier solution that will suffice for most scenarios is to use stateless mode instead, so that no state needs to be shared across your web farm's servers.

您可以通过实例化 OpenIdRelyingParty 通过在您的应用程序存储实例激活无状态的模式。调用默认的构造函数会导致DNOA利用其在内存存储,它打破服务器农场,所以默认构造函数是不够的。

You can activate stateless mode by instantiating OpenIdRelyingParty passing null in as your application store instance. Calling the default constructor will cause DNOA to use its in-memory store, which breaks on server farms, so the default constructor is insufficient.

或者,如果你正在使用ASP.NET控件,只需设置无国籍= TRUE 上的控制。

Or if you're using the ASP.NET controls, just set Stateless = true on the control.

这篇关于如何在会话配置dotNetOpenId少负载均衡环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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