예제 #1
0
        public Task <Client> FindClientByIdAsync(string clientId)
        {
            using (var context = new AuthServerDbContext())
            {
                var client = context.Clients.SingleOrDefault(x => x.Id == clientId);

                var result = new Client()
                {
                    ClientName      = client.Name,
                    ClientId        = client.Id.ToString(),
                    Enabled         = true,
                    AccessTokenType = AccessTokenType.Reference,

                    Flow = Flows.ResourceOwner,

                    ClientSecrets = new List <Secret>
                    {
                        new Secret(client.SecretHash)
                    },

                    AllowedScopes = new List <string>
                    {
                        "AuthApi"
                    }
                };

                return(Task.FromResult(result));
            }
        }
예제 #2
0
 public UserRepository(AuthServerDbContext context)
 {
     _context = context;
 }
예제 #3
0
 public GenericRepository(AuthServerDbContext context)
 {
     _context = context;
     _dbSet   = context.Set <T>();
 }
예제 #4
0
 public UnitOfWork(AuthServerDbContext context)
 {
     _context = context;
 }