Esempio n. 1
0
        public async Task <IActionResult> Index()
        {
            ListAuthenticatedSessionModel model = CreateModel <ListAuthenticatedSessionModel>();

            var sessions = await authenticatedSessionRepository.Get();

            model.Sessions = sessions
                             .Select(api => new AuthenticatedSessionModel
            {
                ID              = api.ID,
                Name            = api.Name,
                Provider        = api.Provider.Provider.Name,
                HasChangedModel = api.HasChangedModel
            })
                             .ToList();

            return(View(model));
        }
Esempio n. 2
0
        private async Task <object> GetAuthenticatedSessionClient(int authenticatedSessionId)
        {
            AuthenticatedSession session = await authenticatedSessionRepository.Get(authenticatedSessionId);

            string decryptedSessionData = await encryptionService.Decrypt <string>(session.SessionData);

            IAuthenticationProvider <object> authenticationProvider = await CreateProvider <IAuthenticationProvider <object> >(session.Provider.ID);

            return(authenticationProvider.GetAuthenticatedClient(decryptedSessionData));
        }