on 12-11-2013 6:33 PM
Hi SAP Experts!
I'd like some help.
We are using the default "dataSourceConfiguration_ads_readonly_db.xml" configuration to access our Active Directory server.
Is it possible to find user domain through com.sap.security.api?
DOMAIN/user
Thanks in advance.
Regards,
Thales Pires
Hi Thales,
I don't have an environment to test this, but looking at the following excerpt of dataSourceConfiguration_ads_readonly_db.xml:
<principal type="account">
<nameSpace name="com.sap.security.core.usermanagement">
<attribute name="j_user"/>
<attribute name="logonalias"/>
<attribute name="j_password"/>
<attribute name="userid"/>
</nameSpace>
<nameSpace name="com.sap.security.core.authentication">
<attribute name="principal"/>
<attribute name="realm"/>
<attribute name="domain"/>
</nameSpace>
</principal>
I assume that the following code will do what you want:
return UMFactory
.getInstance()
.getUserFactory()
.getUserByLogonID("Administrator") //replace this with the logon ID you're interested in
.getUserAccounts()[0]
.getAttribute("com.sap.security.core.authentication", "domain")[0];
For production purposes, you'll want to add some exception and NULL handling to the above code, of course. Let me know if it works.
BR, Lambert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This question isn't answered yet.
I've clicked on "Assumed Answered" by a mistake.
I appreciate any help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.