Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net ADFS单点登录无法使用会话状态模式“;UserUri";_Asp.net_Single Sign On_Adfs_Claims Based Identity - Fatal编程技术网

Asp.net ADFS单点登录无法使用会话状态模式“;UserUri";

Asp.net ADFS单点登录无法使用会话状态模式“;UserUri";,asp.net,single-sign-on,adfs,claims-based-identity,Asp.net,Single Sign On,Adfs,Claims Based Identity,我们的asp.net网站可以很好地使用ADFS SSO,因为我们将会话状态cookie设置从“使用cookie”更改为“使用URI”。进行此更改后,fam.IsSignInResponse(请求)在下面的代码中始终为false,因此它会递归地重定向回ADFS登录屏幕 public List<ClaimEntity> GetClaims() { logger.Info("Started executing GetClaims()");

我们的asp.net网站可以很好地使用ADFS SSO,因为我们将会话状态cookie设置从“使用cookie”更改为“使用URI”。进行此更改后,fam.IsSignInResponse(请求)在下面的代码中始终为false,因此它会递归地重定向回ADFS登录屏幕

public List<ClaimEntity> GetClaims()
        {
            logger.Info("Started executing GetClaims()");
            List<ClaimEntity> claims = new List<ClaimEntity>();
            // sam is configured in web.config
            var sam = FederatedAuthentication.SessionAuthenticationModule;
            logger.Info("Declaring sam");
            // fam is not
            var fam = new WSFederationAuthenticationModule();
            logger.Info("Declaring fam");
            //fam.FederationConfiguration = FederatedAuthentication.FederationConfiguration;
            fam.ServiceConfiguration = FederatedAuthentication.ServiceConfiguration;
            logger.Info("Assigning ServiceConfiguration to fam");
            var request = thisContext.Request;

            // is this the response from the STS
            if (!fam.IsSignInResponse(request))
            {
                // no
                logger.Info("fam.IsSignInResponse => No");
                // the STS
                fam.Issuer = _IssuerSTSSpec.Issuer;
                logger.Info("IssuerUrl= " + _IssuerSTSSpec.Issuer);
                // the return address
                fam.Realm = thisContext.Request.Url.AbsoluteUri;
                logger.Info("Assigning fam.Realm= " + thisContext.Request.Url.AbsoluteUri);
                logger.Info("Creating SignInRequest...");
                var req = fam.CreateSignInRequest(string.Empty, null, false);                
                logger.Info("Redirecting to the issuer...");
                logger.Info("Request to STS: "+ req.WriteQueryString().ToString());
                // go to STS
                thisContext.Response.Redirect(req.WriteQueryString());

            }
            else
            {
                // yes  
        -----------
        -----------

            }
            logger.Info("Returning the claims");
            return claims;
        }
public List GetClaims()
{
Info(“已开始执行GetClaims()”;
列表声明=新列表();
//sam在web.config中配置
var sam=FederatedAuthentication.SessionAuthenticationModule;
logger.Info(“声明sam”);
//法姆不是
var fam=新的WSFederationAuthenticationModule();
logger.Info(“声明fam”);
//fam.FederationConfiguration=FederatedAuthentication.FederationConfiguration;
fam.ServiceConfiguration=FederatedAuthentication.ServiceConfiguration;
logger.Info(“将ServiceConfiguration分配给fam”);
var request=thisContext.request;
//这是STS的回应吗
如果(!fam.IsSignInResponse(请求))
{
//没有
logger.Info(“fam.IsSignInResponse=>No”);
//STS
fam.Issuer=_IssuerSTSSpec.Issuer;
logger.Info(“IssuerUrl=“+_ISSUERSTSPEC.Issuer”);
//回信地址
fam.Realm=thisContext.Request.Url.AbsoluteUri;
logger.Info(“Assigning fam.Realm=“+thisContext.Request.Url.AbsoluteUri”);
logger.Info(“创建SignInRequest…”);
var req=fam.CreateSignInRequest(string.Empty、null、false);
logger.Info(“重定向到发行人…”);
logger.Info(“对STS的请求:+req.WriteQueryString().ToString());
//去STS
thisContext.Response.Redirect(req.WriteQueryString());
}
其他的
{
//对
-----------
-----------
}
logger.Info(“返回索赔”);
退货索赔;
}

ADFS集成应用程序是否不支持“使用URI”会话cookie模式,或者我的代码中是否需要任何更改?

如果添加“使用URI”的示例代码,将有助于更好地理解。 真的有必要使用这种方法吗?
使用cookies将保持URL的干净,并且更易于管理。如果它已经对您起作用,您可以使用它,除非确实需要使用URI

任何帮助都将不胜感激,因为我们的一个版本因为这个问题而被阻止。专家们,请提供一些意见。