public async Task <IActionResult> GetDetails([FromQuery] SearchDetailsRequest request) { if (string.IsNullOrWhiteSpace(request.ClientId) && string.IsNullOrWhiteSpace(request.Token)) { return(BadRequest("Request is null")); } //var res = await _oAuthService.GetDetails(request); var res = new Client { ClientId = "Jeremy", Secret = "Henry", ClientResourceAccess = new List <ClientResourceAccess> { new ClientResourceAccess { ClientId = "CJ", Access = "12345", ResourceId = "zzzzz" } } }; return(Ok(res)); }
public async Task <IActionResult> GetDetails([FromQuery] SearchDetailsRequest request) { if (string.IsNullOrWhiteSpace(request.ClientId) && string.IsNullOrWhiteSpace(request.Token)) { return(BadRequest("Request is null")); } var res = await _oAuthService.GetDetails(request); return(Ok(res)); }
public async Task <Client> GetDetails(SearchDetailsRequest request) { var clientId = (!string.IsNullOrWhiteSpace(request.Token) ? (await oAuthContext.AccessToken.SingleOrDefaultAsync(x => x.Token == request.Token))?.ClientId : request.ClientId)?.Trim(); return(string.IsNullOrEmpty(clientId) ? null : await oAuthContext.Client .Include(x => x.ClientAccessParameter) .Include(x => x.ClientResourceAccess) .Include(x => x.ClientImpersonationClient) .SingleOrDefaultAsync(x => x.ClientId == clientId)); }