public class DefaultClientPolicyManager extends Object implements ClientPolicyManager
Modifier and Type | Field and Description |
---|---|
static String |
CLIENT_POLICIES |
static String |
CLIENT_PROFILES |
Constructor and Description |
---|
DefaultClientPolicyManager(KeycloakSession session) |
Modifier and Type | Method and Description |
---|---|
String |
getClientPolicies(RealmModel realm)
when getting client policies via Admin REST API, returns the existing client policies set on the realm.
|
String |
getClientPoliciesJsonString(RealmModel realm)
returns the json representation of the client policies set on the realm.
|
String |
getClientPoliciesOnKeycloakApp()
returns the json representation of the builtin client policies set on keycloak application.
|
String |
getClientProfiles(RealmModel realm)
when getting client profiles via Admin REST API, returns the existing client profiles set on the realm.
|
String |
getClientProfilesJsonString(RealmModel realm)
returns the json representation of the client profiles set on the realm.
|
String |
getClientProfilesOnKeycloakApp()
returns the json representation of the builtin client profiles set on keycloak application.
|
void |
setupClientPoliciesOnCreatedRealm(RealmModel realm)
when creating a realm, reads the builtin client profiles and policies
that have already been set on keycloak application on booting keycloak and put them onto the realm as its attribute.
|
void |
setupClientPoliciesOnExportingRealm(RealmModel realm,
RealmRepresentation rep)
when exporting realm the realm, prepares the exported representation of the client profiles and policies.
|
void |
setupClientPoliciesOnImportedRealm(RealmModel realm,
RealmRepresentation rep)
when importing a realm, reads the builtin client profiles and policies
that have already been set on keycloak application on booting keycloak and override them
with ones loaded from the imported realm json file.
|
void |
setupClientPoliciesOnKeycloakApp(String profilesFilePath,
String policiesFilePath)
when booting keycloak, reads json representations of the builtin client profiles and policies from files
enclosed in keycloak-services jar file and put them onto the keycloak application.
|
void |
triggerOnEvent(ClientPolicyContext context)
execute a method for handling an event defined in
ClientPolicyEvent . |
void |
updateClientPolicies(RealmModel realm,
String json)
when updating client policies via Admin REST API, reads the json representation of the client policies
and overrides the existing client policies set on the realm with them.
|
void |
updateClientProfiles(RealmModel realm,
String json)
when updating client profiles via Admin REST API, reads the json representation of the client profiles
and overrides the existing client profiles set on the realm with them.
|
public static final String CLIENT_PROFILES
public static final String CLIENT_POLICIES
public DefaultClientPolicyManager(KeycloakSession session)
public void triggerOnEvent(ClientPolicyContext context) throws ClientPolicyException
ClientPolicyManager
ClientPolicyEvent
.triggerOnEvent
in interface ClientPolicyManager
context
- - the context of the event.ClientPolicyException
public void setupClientPoliciesOnKeycloakApp(String profilesFilePath, String policiesFilePath)
ClientPolicyManager
setupClientPoliciesOnKeycloakApp
in interface ClientPolicyManager
profilesFilePath
- - the file path for the builtin client profilespoliciesFilePath
- - the file path for the builtin client policiespublic void setupClientPoliciesOnCreatedRealm(RealmModel realm)
ClientPolicyManager
setupClientPoliciesOnCreatedRealm
in interface ClientPolicyManager
realm
- - the newly created realmpublic void setupClientPoliciesOnImportedRealm(RealmModel realm, RealmRepresentation rep)
ClientPolicyManager
setupClientPoliciesOnImportedRealm
in interface ClientPolicyManager
realm
- - the newly created realm to be overriden by imported realm's representationrep
- - imported realm's representationpublic void updateClientProfiles(RealmModel realm, String json) throws ClientPolicyException
ClientPolicyManager
updateClientProfiles
in interface ClientPolicyManager
realm
- - the realm whose client profiles is to be overriden by the new client profilesjson
- - the json representation of the new client profiles that overrides the existing client profiles set on the realmClientPolicyException
public String getClientProfiles(RealmModel realm)
ClientPolicyManager
getClientProfiles
in interface ClientPolicyManager
realm
- - the realm whose client profiles is to be returnedpublic void updateClientPolicies(RealmModel realm, String json) throws ClientPolicyException
ClientPolicyManager
updateClientPolicies
in interface ClientPolicyManager
realm
- - the realm whose client policies is to be overriden by the new client policiesjson
- - the json representation of the new client policies that overrides the existing client policies set on the realmClientPolicyException
public void setupClientPoliciesOnExportingRealm(RealmModel realm, RealmRepresentation rep)
ClientPolicyManager
setupClientPoliciesOnExportingRealm
in interface ClientPolicyManager
realm
- - the realm to be exportedrep
- - the realm's representation to be exported actuallypublic String getClientPolicies(RealmModel realm)
ClientPolicyManager
getClientPolicies
in interface ClientPolicyManager
realm
- - the realm whose client policies is to be returnedpublic String getClientProfilesOnKeycloakApp()
ClientPolicyManager
getClientProfilesOnKeycloakApp
in interface ClientPolicyManager
public String getClientPoliciesOnKeycloakApp()
ClientPolicyManager
getClientPoliciesOnKeycloakApp
in interface ClientPolicyManager
public String getClientProfilesJsonString(RealmModel realm)
ClientPolicyManager
getClientProfilesJsonString
in interface ClientPolicyManager
realm
- - the realm whose client profiles is to be returnedpublic String getClientPoliciesJsonString(RealmModel realm)
ClientPolicyManager
getClientPoliciesJsonString
in interface ClientPolicyManager
realm
- - the realm whose client policies is to be returnedCopyright © 2021 JBoss by Red Hat. All rights reserved.