当前位置: 首页>>代码示例>>C#>>正文


C# IAuthSession.PopulateWith方法代码示例

本文整理汇总了C#中IAuthSession.PopulateWith方法的典型用法代码示例。如果您正苦于以下问题:C# IAuthSession.PopulateWith方法的具体用法?C# IAuthSession.PopulateWith怎么用?C# IAuthSession.PopulateWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAuthSession的用法示例。


在下文中一共展示了IAuthSession.PopulateWith方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadUserAuth

        private void LoadUserAuth(IAuthSession session, UserAuth userAuth)
        {
            if (userAuth == null) return;

            session.PopulateWith(userAuth);
            session.UserAuthId = userAuth.Id.ToString(CultureInfo.InvariantCulture);
            session.ProviderOAuthAccess = GetUserAuthDetails(session.UserAuthId)
                .ConvertAll(x => (IAuthTokens)x);
        }
开发者ID:BilliamBrown,项目名称:ServiceStack,代码行数:9,代码来源:NHibernateUserAuthRepository.cs

示例2: OnCreated

        public void OnCreated(IRequest httpReq, IAuthSession session)
        {
            if (!httpReq.Items.ContainsKey(SessionCopyRequestItemKey)) return;
            var copy = httpReq.Items[SessionCopyRequestItemKey] as IWebSudoAuthSession;
            if (copy == null) return;

            var id = session.Id;
            var created = session.CreatedAt;

            session.PopulateWith(copy);
            session.Id = id;
            session.CreatedAt = created;
        }
开发者ID:CLupica,项目名称:ServiceStack,代码行数:13,代码来源:WebSudoFeature.cs

示例3: LoadUserAuth

		private void LoadUserAuth(IAuthSession session, UserAuth userAuth)
		{
			if (userAuth == null) return;

			var idSesije = session.Id;  //first record session Id (original session Id)
			session.PopulateWith(userAuth); //here, original sessionId is overwritten with facebook user Id
			session.Id = idSesije;  //we return Id of original session here

			session.UserAuthId = userAuth.Id.ToString(CultureInfo.InvariantCulture);
			session.ProviderOAuthAccess = GetUserOAuthProviders(session.UserAuthId)
				.ConvertAll(x => (IOAuthTokens)x);

		}
开发者ID:JackFong,项目名称:ServiceStack.Contrib,代码行数:13,代码来源:RavenUserAuthRepository.cs

示例4: PopulateSession

 protected void PopulateSession(IUserAuthRepository authRepo, IUserAuth userAuth, IAuthSession session)
 {
     var holdSessionId = session.Id;
     session.PopulateWith(userAuth); //overwrites session.Id
     session.Id = holdSessionId;
     session.IsAuthenticated = true;
     session.UserAuthId = userAuth.Id.ToString(CultureInfo.InvariantCulture);
     session.ProviderOAuthAccess = authRepo.GetUserAuthDetails(session.UserAuthId)
         .ConvertAll(x => (IAuthTokens)x);
 }
开发者ID:migajek,项目名称:ServiceStack,代码行数:10,代码来源:AuthProvider.cs

示例5: LoadUserAuth

        /// <summary>
        /// Load the user auth based on the session.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="tokens">The tokens.</param>
        /// <exception cref="ArgumentException">
        /// Exception thrown if session is null.
        /// </exception>
        public void LoadUserAuth(IAuthSession session, IAuthTokens tokens)
        {
            session.ThrowIfNull("session");

            var userAuth = this.GetUserAuth(session, tokens) as LightSpeed.UserAuth;
            if (userAuth == null)
            {
                return;
            }

            // Re-populate the session
            var sessionId = session.Id;
            session.PopulateWith(userAuth);
            session.Id = sessionId;
            session.UserAuthId = userAuth.Id.ToString(CultureInfo.InvariantCulture);
            session.ProviderOAuthAccess =
                this.GetUserAuthDetails(session.UserAuthId)
                    .ConvertAll(x => (IAuthTokens)x);
        }
开发者ID:hhandoko,项目名称:ServiceStack.Authentication.LightSpeed,代码行数:27,代码来源:LightSpeedUserAuthRepository.cs


注:本文中的IAuthSession.PopulateWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。