本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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