diff --git a/services/src/main/java/org/keycloak/services/resources/account/AccountRestService.java b/services/src/main/java/org/keycloak/services/resources/account/AccountRestService.java index f22fe29727..a27f594261 100755 --- a/services/src/main/java/org/keycloak/services/resources/account/AccountRestService.java +++ b/services/src/main/java/org/keycloak/services/resources/account/AccountRestService.java @@ -311,7 +311,7 @@ public class AccountRestService { private ConsentRepresentation modelToRepresentation(UserConsentModel model) { List grantedScopes = model.getGrantedClientScopes().stream() - .map(m -> new ConsentScopeRepresentation(m.getId(), m.getName(), StringPropertyReplacer.replaceProperties(m.getConsentScreenText(), getProperties()))) + .map(m -> new ConsentScopeRepresentation(m.getId(), m.getConsentScreenText()!= null ? m.getConsentScreenText() : m.getName(), StringPropertyReplacer.replaceProperties(m.getConsentScreenText(), getProperties()))) .collect(Collectors.toList()); return new ConsentRepresentation(grantedScopes, model.getCreatedDate(), model.getLastUpdatedDate()); } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AccountRestServiceTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AccountRestServiceTest.java index b01ba80409..0eab506922 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AccountRestServiceTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AccountRestServiceTest.java @@ -33,6 +33,7 @@ import org.keycloak.credential.CredentialTypeMetadata; import org.keycloak.events.Details; import org.keycloak.events.EventType; import org.keycloak.models.AuthenticationExecutionModel; +import org.keycloak.models.ClientScopeModel; import org.keycloak.models.UserModel; import org.keycloak.models.credential.OTPCredentialModel; import org.keycloak.models.credential.PasswordCredentialModel; @@ -962,7 +963,7 @@ public class AccountRestServiceTest extends AbstractRestServiceTest { assertFalse(app.getConsent().getGrantedScopes().isEmpty()); ConsentScopeRepresentation grantedScope = app.getConsent().getGrantedScopes().get(0); assertEquals(clientScopeRepresentation.getId(), grantedScope.getId()); - assertEquals(clientScopeRepresentation.getName(), grantedScope.getName()); + assertEquals(clientScopeRepresentation.getAttributes().get(ClientScopeModel.CONSENT_SCREEN_TEXT) != null ? clientScopeRepresentation.getAttributes().get(ClientScopeModel.CONSENT_SCREEN_TEXT) : clientScopeRepresentation.getName(), grantedScope.getName()); } @Test diff --git a/themes/src/main/resources/theme/keycloak.v2/account/src/app/content/applications-page/ApplicationsPage.tsx b/themes/src/main/resources/theme/keycloak.v2/account/src/app/content/applications-page/ApplicationsPage.tsx index 06e2aa55aa..653ebe59b8 100644 --- a/themes/src/main/resources/theme/keycloak.v2/account/src/app/content/applications-page/ApplicationsPage.tsx +++ b/themes/src/main/resources/theme/keycloak.v2/account/src/app/content/applications-page/ApplicationsPage.tsx @@ -224,7 +224,7 @@ export class ApplicationsPage extends React.Component { return ( - {scope.name} + {Msg.localize(scope.name)} ) })}