[OPENAM-16775] Public API access to org.forgerock.openam.core.realms.Realms method(s) Created: 10/Sep/20  Updated: 14/Sep/20  Resolved: 14/Sep/20

Status: Closed
Project: OpenAM
Component/s: API descriptor
Affects Version/s:
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Anastasios Kampas Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Rank: 1|i0230v:
Support Ticket IDs:


Specifically the #of method:


returns the realm in Realm type, instead of a String. This is needed when trying to use annotated service but the calling service doesn't support injection.

For example, PAP doesn't support injection. If it needs to access an annotated service, then it needs to call the #getRealmSingleton method:

getRealmSingleton(Class<T> serviceInterface, Realm realm)

So, one can use 

String realm = DNMapper.orgNameToRealmName(ssoToken.getProperty("Organization"));

and then use Realms.of(realm) to get the realm in Realm type.


The workaround is to create a global service and then use #getGlobalSingleton where Realm is not required, but global service is not always an accepted solution.

It's quite unlikely to update PAP to support injection, so making the #of method would be useful.

Comment by Andy Hall [ 14/Sep/20 ]

Effort should be focussed in OPENAM-14814

Generated at Thu Feb 25 16:01:05 UTC 2021 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.