Inheritance: DbContext
        public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
        {
            // Allow CORS on the token middleware provider
            context.OwinContext.Response.Headers.Add("Access-Control-Allow-Origin", new[] { "*" });

            //TODO
            // Usually this would be done via dependency injection
            // But I haven't got it to work with the OWIN startup class yet
            AppDBContext _ctx = new AppDBContext();
            UserRepository _repo = new UserRepository(_ctx);

                IdentityUser user = await _repo.FindUser(context.UserName, context.Password);

                if (user == null)
                {
                    context.SetError("invalid_grant", "The user name or password is incorrect.");
                    return;
                }

            var identity = new ClaimsIdentity(context.Options.AuthenticationType);
            identity.AddClaim(new Claim("sub", context.UserName));
            identity.AddClaim(new Claim("role", "user"));

            context.Validated(identity);

        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            db = new AppDBContext();

            var externalAuthClients = db.ExternalAuthClients.ToList();
            if(externalAuthClients == null || externalAuthClients.Count == 0)
            {
                StatusText.Text = "Does not exist any record yet";
                StatusPane.Visible = true;
            }
            else
            {
                grdVAuthLogins.DataSource = externalAuthClients;
                grdVAuthLogins.DataBind();
            }
            db.Dispose();
        }
Exemplo n.º 3
0
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            db = new AppDBContext();

            var url = txtUrl.Text;

            Guid g = Guid.NewGuid();
            string urlId = g.ToString();
            urlId = urlId.Replace("-", "");

            var authUrlitem = new ExternalAuthClients
            {
                Id = urlId,
                Url = url,
                Name = txtName.Text
            };
            db.ExternalAuthClients.Add(authUrlitem);
            db.SaveChanges();

            Response.Redirect(Request.RawUrl);
            db.Dispose();
        }
Exemplo n.º 4
0
 public UserTestController(AppDBContext context)
 {
     this.context = context;
 }
Exemplo n.º 5
0
 public RequestQuotationRepository(AppDBContext context) : base(context)
 {
 }
Exemplo n.º 6
0
 public ContactService(AppDBContext context)
 {
     _datacontext = context;
 }
Exemplo n.º 7
0
        //private List<Car> _cars;

        public CarService(AppDBContext context)
        {
            this.context = context;
        }
Exemplo n.º 8
0
 public IndexModel(AppDBContext db)
 {
     _context = db;
 }
Exemplo n.º 9
0
 public Repository(AppDBContext context)
 {
     this._context = context;
 }
Exemplo n.º 10
0
 public MItemGroupsController(AppDBContext context)
 {
     _context = context;
 }
Exemplo n.º 11
0
 public MconditionsController(AppDBContext context)
 {
     _context = context;
 }
Exemplo n.º 12
0
 public HomeController(ILogger <HomeController> logger, UserManager <IdentityUser> userManager, SignInManager <IdentityUser> signInManager, AppDBContext context, RoleManager <IdentityRole> roleManager)
 {
     _logger        = logger;
     _userManager   = userManager;
     _signInManager = signInManager;
     _context       = context;
     _roleManager   = roleManager;
 }
 public ProductService(AppDBContext dbContext, IMapper mapper, ILogger <ProductService> log)
 {
     _dbContext = dbContext;
     _mapper    = mapper;
     _log       = log;
 }
Exemplo n.º 14
0
 public ReferencesRepository(AppDBContext context)
 {
     _context = context;
 }
Exemplo n.º 15
0
 public empleadoController(AppDBContext context)
 {
     _context = context;
 }
Exemplo n.º 16
0
 public CategoryService(AppDBContext stockTrackingEntities) : base(stockTrackingEntities)
 {
 }
Exemplo n.º 17
0
 public TrainingsController(AppDBContext context, ITrainingRepository trainingRepository)
 {
     _context = context;
     this.trainingRepository = trainingRepository;
 }
Exemplo n.º 18
0
 public EFContractorRepository(AppDBContext context)
 {
     this.context = context;
 }
 public MembersController(AppDBContext context, UserManager <IdentityUser> userManager)
 {
     _context     = context;
     _userManager = userManager;
 }
Exemplo n.º 20
0
 public GetUrlController(ILogger <GetUrlController> logger, AppDBContext appDbContext, IConfiguration configuration)
 {
     _logger       = logger;
     _AppDbContext = appDbContext;
     Configuration = configuration;
 }
 public ViajanteRepository(AppDBContext appDBContext)
 {
     _appDBContext = appDBContext;
 }
Exemplo n.º 22
0
 public ItemTypeController(AppDBContext context)
 {
     _context = context;
 }
Exemplo n.º 23
0
 public VideoRepository(AppDBContext appDbContext)
 {
     this._appDbContext = appDbContext;
 }
Exemplo n.º 24
0
 public ProductsRepository(AppDBContext appDBContext) : base(appDBContext)
 {
 }
 public DepartmentController(AppDBContext dBContext, IRepository repository)
 {
     _repository = repository;
 }
Exemplo n.º 26
0
 public PropertyRepository(AppDBContext context) : base(context)
 {
 }
 public ServiceBase(AppDBContext dbContext, IMapper mapper, IHttpContextAccessor httpContext)
 {
     _dbContext   = dbContext;
     _mapper      = mapper;
     _httpContext = httpContext;
 }
Exemplo n.º 28
0
 public CategoryRepository(AppDBContext context) : base(context)
 {
 }
 public WholesalerRepository(AppDBContext ctx)
 {
     _ctx = ctx;
 }
Exemplo n.º 30
0
 public RatingRepository(AppDBContext context) : base(context, ProgressPrice.Basic)
 {
     _context = context;
 }
Exemplo n.º 31
0
 public void Dispose()
 {
     if (_db != null)
     {
         _db.Dispose();
         _db = null;
     }
     if (_usrDb != null)
     {
         _usrDb.Dispose();
         _usrDb = null;
     }
 }
Exemplo n.º 32
0
 public AccountController(AppDBContext context)
 {
     db = context;
 }
Exemplo n.º 33
0
 public GCalendarioModel(IRepositoryCalendario repositoryCalendario, IRepositoryRegistroEscuela repositorioEscuela, AppDBContext context)
 {
     this.repositoryCalendario = repositoryCalendario;
     this.repositorioEscuela   = repositorioEscuela;
     _context = context;
 }
Exemplo n.º 34
0
 public CartRepository(AppDBContext ctx)
 {
     _ctx = ctx;
 }
Exemplo n.º 35
0
 public UsersController(AppDBContext context)
 {
     _context = context;
 }
 public EditModel(AppDBContext db)
 {
     _db = db;
 }
Exemplo n.º 37
0
 public ProductRepository(AppDBContext ctx)
 {
     _ctx = ctx;
 }