Realm can be marked as a template. This means that if a different realm name is requested using the API and such name contains template realm as a prefix then this realm configuration will be used
<realm> <id>idm_realm</id> <repository-id-ref>DefaultRepository</repository-id-ref> <identity-type-mappings> <user-mapping>USER</user-mapping> </identity-type-mappings> <options> <option> <name>template</name> <value>true</value> </option> </options> </realm>
In this example for "idm_realm_foo" framework will return "idm_realm" configuration. Request for "foo" realm won't return valid configuration.
<realms> <realm> <id>idm_realm</id> <repository-id-ref>DefaultRepository</repository-id-ref> <identity-type-mappings> <user-mapping>USER</user-mapping> </identity-type-mappings> </realm> </realms> <repositories>...</repositories> <stores>...</stores> <options> <option> <name>defaultTemplate</name> <value>idm_realm</value> </option> </options>
The "defaultTemplate" option defines idm_realm as the one that should be used when requested realm name is not found in configuration