Esempio n. 1
0
 public LoginController()
 {
     this._operations = new BusinessLogic.Usuario.Usuario(new bloodbog_bdEntities());
     dataToken        = new List <string>();
     dataToken.Add(ConfigurationManager.AppSettings["JWT_SECRET_KEY"]);
     dataToken.Add(ConfigurationManager.AppSettings["JWT_AUDIENCE_TOKEN"]);
     dataToken.Add(ConfigurationManager.AppSettings["JWT_ISSUER_TOKEN"]);
     dataToken.Add(ConfigurationManager.AppSettings["JWT_EXPIRE_MINUTES"]);
 }
Esempio n. 2
0
        public UsuarioController()
        {
            var identity = (ClaimsPrincipal)Thread.CurrentPrincipal;

            this._operations = new BusinessLogic.Usuario.Usuario(new bloodbog_bdEntities());
            dataToken        = new List <string>();
            dataToken.Add(ConfigurationManager.AppSettings["JWT_SECRET_KEY"]);
            dataToken.Add(ConfigurationManager.AppSettings["JWT_AUDIENCE_TOKEN"]);
            dataToken.Add(ConfigurationManager.AppSettings["JWT_ISSUER_TOKEN"]);
            dataToken.Add(ConfigurationManager.AppSettings["JWT_EXPIRE_MINUTES"]);
            idUserClaim = identity.Claims.Where(c => c.Type == ClaimTypes.Name)
                          .Select(c => c.Value).SingleOrDefault();
        }