public async Task <bool> AddPostLogoutUriToClient(int clientId, ClientPostLogoutUrlDto clientPostLogoutDto) { await this._configContext.AddAsync(new IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri { ClientId = clientPostLogoutDto.ClientId, PostLogoutRedirectUri = clientPostLogoutDto.PostLogoutRedirectUri }); return(true); }
public async Task <ActionResult <int> > UpdateClientPostLogoutUriAsync([FromBody] ClientPostLogoutUrlDto clientPostLogoutDto) { var currentClient = await this._configurationManagementService.ReturnClientAsync(clientPostLogoutDto.ClientId); if (currentClient == null) { return(NotFound()); } await this._configurationManagementService.UpdateClientPostLogoutUriAsync(clientPostLogoutDto); await this._configurationManagementService.SaveChangesAsync(); return(NoContent()); }
public async Task <ActionResult> AddPostLogoutUriToClient(int clientId, [FromBody] ClientPostLogoutUrlDto clientPostLogoutDto) { if (clientId == 0 || clientPostLogoutDto == null) { return(BadRequest()); } var currentClient = await this._configurationManagementService.ReturnClientAsync(clientId); if (currentClient == null) { return(NotFound()); } var result = await this._configurationManagementService.AddPostLogoutUriToClient(clientId, clientPostLogoutDto); await this._configurationManagementService.SaveChangesAsync(); return(Ok(result)); }
public async Task RemovePostLogoutsFromClaims(ClientPostLogoutUrlDto postLogoutUriDto) { var client = await this._configContext .Clients.Include(c => c.PostLogoutRedirectUris) .FirstOrDefaultAsync(i => i.Id == postLogoutUriDto.ClientId); if (client == null) { throw new Exception("Entity Not Found"); } var foundRedirectUril = client.PostLogoutRedirectUris.FirstOrDefault(c => c.Id == postLogoutUriDto.Id); if (foundRedirectUril == null) { throw new Exception("PostLogoutUriDto not found"); } this._configContext.Remove(foundRedirectUril); }
public async Task <int> UpdateClientPostLogoutUriAsync(ClientPostLogoutUrlDto clientPostLogoutDto) { var client = await this._configContext .Clients.Include(c => c.PostLogoutRedirectUris) .FirstOrDefaultAsync(i => i.Id == clientPostLogoutDto.ClientId); if (client == null) { throw new Exception("Entity Not Found"); } var foundRedirectUri = client.PostLogoutRedirectUris.FirstOrDefault(c => c.Id == clientPostLogoutDto.Id); if (foundRedirectUri == null) { throw new Exception("RedirectUri not found"); } foundRedirectUri.PostLogoutRedirectUri = clientPostLogoutDto.PostLogoutRedirectUri; return(this._configContext.Update(foundRedirectUri).Entity.Id); }