File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
js/apps/admin-ui/src/components/users
rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import { emptyFormatter } from "../../util";
4343import { useConfirmDialog } from "../confirm-dialog/ConfirmDialog" ;
4444import { BruteUser , findUsers } from "../role-mapping/resource" ;
4545import { UserDataTableToolbarItems } from "./UserDataTableToolbarItems" ;
46+ import { NetworkError } from "@keycloak/keycloak-admin-client" ;
4647
4748export type UserFilter = {
4849 exact : boolean ;
@@ -141,8 +142,13 @@ export function UserDataTable() {
141142 fetchRealmInfo ( adminClient ) ,
142143 adminClient . users . getProfile ( ) ,
143144 ] ) ;
144- } catch {
145- return [ { } , { } ] as [ UiRealmInfo , UserProfileConfig ] ;
145+ } catch ( error ) {
146+ if ( error instanceof NetworkError && error ?. response ?. status === 403 ) {
147+ // "User Profile" attributes not available for Users Attribute search, when admin user does not have view- or manage-realm realm-management role
148+ return [ { } , { } ] as [ UiRealmInfo , UserProfileConfig ] ;
149+ } else {
150+ throw error ;
151+ }
146152 }
147153 } ,
148154 ( [ uiRealmInfo , profile ] ) => {
Original file line number Diff line number Diff line change 1919
2020package org .keycloak .admin .ui .rest ;
2121
22+ import jakarta .ws .rs .Produces ;
2223import org .eclipse .microprofile .openapi .annotations .Operation ;
2324import org .eclipse .microprofile .openapi .annotations .enums .SchemaType ;
2425import org .eclipse .microprofile .openapi .annotations .media .Content ;
@@ -81,6 +82,7 @@ public Response updateRealm(UIRealmRepresentation rep) {
8182 @ Operation (summary = "Gets information about the realm, viewable by all realm admins" )
8283 @ APIResponse (responseCode = "200" , description = "" , content = {
8384 @ Content (schema = @ Schema (implementation = UIRealmInfo .class , type = SchemaType .OBJECT ))})
85+ @ Produces (MediaType .APPLICATION_JSON )
8486 public UIRealmInfo getInfo () {
8587 auth .requireAnyAdminRole ();
8688
You can’t perform that action at this time.
0 commit comments