public async Task <(SessionEntity, string)> CreateSessionAsync(string tenantId, long clientId, string publicKey = null) { var(session, token) = SessionEntity.Generate(_sessionConfig.ExpirationTimeInMins); session.PublicKey = publicKey; session.ClientId = clientId; session.TenantId = tenantId; await _sessionsWriter.InsertOrReplaceAsync(session); return(session, token); }
public async Task <string> CreateSessionAsync(string token, string publicKey = null) { string sessionId = SessionEntity.GenerateSessionId(); var session = SessionEntity.Generate(_expirationTimeInMins, sessionId); session.Token = token; session.PublicKey = publicKey; var lykkeSession = await _clientSessionsClient.GetAsync(token); session.ClientId = lykkeSession.ClientId; session.PartnerId = lykkeSession.PartnerId; session.LykkeSessionId = lykkeSession.AuthId.ToString(); await _sessionsWriter.InsertOrReplaceAsync(session); return(sessionId); }