public async Task <IActionResult> ApiResource(ApiResourceDto apiResource) { if (!ModelState.IsValid) { return(View(apiResource)); } ComboBoxHelpers.PopulateValuesToList(apiResource.UserClaimsItems, apiResource.UserClaims); int apiResourceId; if (apiResource.Id == 0) { apiResourceId = await _apiResourceService.AddApiResourceAsync(apiResource); } else { apiResourceId = apiResource.Id; await _apiResourceService.UpdateApiResourceAsync(apiResource); } SuccessNotification(string.Format(_localizer["SuccessAddApiResource"], apiResource.Name), _localizer["SuccessTitle"]); return(RedirectToAction(nameof(ApiResource), new { Id = apiResourceId })); }
public async Task <IActionResult> ApiResource(ApiResourceDto apiResource) { if (!ModelState.IsValid) { return(Success(apiResource)); } ComboBoxHelpers.PopulateValuesToList(apiResource.UserClaimsItems, apiResource.UserClaims); int apiResourceId; if (apiResource.Id == 0) { apiResourceId = await _apiResourceService.AddApiResourceAsync(apiResource); } else { apiResourceId = apiResource.Id; await _apiResourceService.UpdateApiResourceAsync(apiResource); } return(Success(new { Id = apiResourceId })); }
public async virtual Task <ApiScopesDto> BuildApiScopeViewModelAsync(ApiScopesDto apiScope) { ComboBoxHelpers.PopulateValuesToList(apiScope.UserClaimsItems, apiScope.UserClaims); apiScope.ResourceName = await GetApiResourceNameAsync(apiScope.ApiResourceId); return(apiScope); }
private void PopulateClientRelations(ClientDto client) { ComboBoxHelpers.PopulateValuesToList(client.AllowedScopesItems, client.AllowedScopes); ComboBoxHelpers.PopulateValuesToList(client.PostLogoutRedirectUrisItems, client.PostLogoutRedirectUris); ComboBoxHelpers.PopulateValuesToList(client.IdentityProviderRestrictionsItems, client.IdentityProviderRestrictions); ComboBoxHelpers.PopulateValuesToList(client.RedirectUrisItems, client.RedirectUris); ComboBoxHelpers.PopulateValuesToList(client.AllowedCorsOriginsItems, client.AllowedCorsOrigins); ComboBoxHelpers.PopulateValuesToList(client.AllowedGrantTypesItems, client.AllowedGrantTypes); }
public ApiScopesDto BuildApiScopeViewModel(ApiScopesDto apiScope) { ComboBoxHelpers.PopulateValuesToList(apiScope.UserClaimsItems, apiScope.UserClaims); return(apiScope); }
public IdentityResourceDto BuildIdentityResourceViewModel(IdentityResourceDto identityResource) { ComboBoxHelpers.PopulateValuesToList(identityResource.UserClaimsItems, identityResource.UserClaims); return(identityResource); }