是SessionSecurityToken一生一样sessionTokenRequirement一辈子? [英] Is SessionSecurityToken lifeTime the same as sessionTokenRequirement lifetime?

查看:186
本文介绍了是SessionSecurityToken一生一样sessionTokenRequirement一辈子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我迁移窗体身份验证在web表单对面Microsoft身份。

I'm migrating forms authentication in webforms across to Microsoft Identity.

当创建一个 SessionSecurityToken 使用 ClaimsPrincipal CP 对象,我有这样的code:

When creating a SessionSecurityToken using a ClaimsPrincipal cp object, I have this code:

Dim token As New SessionSecurityToken(cp, TimeSpan.FromMinutes(30))

然而,在web.config中我也看到了这一点:

However, in web.config I also see this:

<configSections>
    <section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</configSections>
<system.identityModel>
    <identityConfiguration>
        <securityTokenHandlers>
            <add type="System.IdentityModel.Tokens.SessionSecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089">
                <sessionTokenRequirement lifetime="00:30:00" /><!-- 30 minutes -->  
            </add>
        </securityTokenHandlers>
    </identityConfiguration>
</system.identityModel>

这些是一回事吗?为了证明我RTFM, sessionTokenRequirement一辈子定义为

指定会话令牌的生存期。

Specifies the lifetime of session tokens.

SessionSecurityToken一辈子定义为

这其间令牌有效当前的时间段。该ValidFrom属性将被设置为UtcNow和ValidTo属性将被设定为ValidFrom加上由该参数指定的周期。

The period from the current time during which the token is valid. The ValidFrom property will be set to UtcNow and the ValidTo property will be set to ValidFrom plus the period specified by this parameter.

前者看起来模糊,所以我不知道。

The former seems vague, so I'm not sure.

推荐答案

在应用联盟或基于声明的身份验证,有两个实体 - 依赖方(RP)和身份提供者(IDP)

In application federation or claims based authentication, there are two entities - Relying Party (RP) and Identity Provider (IdP)

在微软的世界,ADFS通常是取决于ADFS进行身份验证将是RP境内流离失所者和应用程序。

In Microsoft world, ADFS would typically be the IdP, and your application that depends on ADFS for authentication would be the RP.

在验证,IDP生成一个声明令牌是由的IdP证书签名。 RP接受此声明令牌 - 做不同的验证包括使用的IdP证书的数字签名。一旦索赔成功的验证令牌,RP问题在cookie的形式会话令牌。这个cookie的默认名称为FedAuth。 SessionTokenRequirement寿命参数与FedAuth令牌的生命周期有关。

On authentication, IdP generates a claims token which is signed by IdP certificate. RP accepts this claims token - does various validation including that of digital signature using IdP's certificate. Upon successful validation of claims token, RP issues a session token in the form of a cookie. The default name of this cookie is FedAuth. SessionTokenRequirement lifetime parameter is associated with FedAuth token's lifetime.

SessionSucurityToken寿命与声明令牌由颁发的IdP的生命周期相关的。

SessionSucurityToken lifetime is associated with the lifetime of claims token issued by IdP.

请参考:
<一href=\"http://brockallen.com/2013/02/14/configuring-session-token-lifetime-in-wif-with-the-session-authentication-module-sam-and-thinktecture-identitymodel/\" rel=\"nofollow\">http://brockallen.com/2013/02/14/configuring-session-token-lifetime-in-wif-with-the-session-authentication-module-sam-and-thinktecture-identitymodel/

http://msdn.microsoft.com /en-us/library/hh568645(v=vs.110).aspx

这篇关于是SessionSecurityToken一生一样sessionTokenRequirement一辈子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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