on 03-11-2008 3:28 PM
Hello,
I'm facing the following problem.
A file is read by an ABAP-program, from an external system and the entries (user names, e-mail addresses, etc) are fed into our R/3 system (SU01).
Untill now this was sufficient. But now we're trying to implement Single Sign On, so we also need to fill the field krb5principalname, which is used in the Portal.
I've looked everywhere, but I have no idea how to accomplish this. The field krb5principalname is (as far as I can tell) only known in the JAVA stack.
Does anyone have an idea how I could fill this field from an ABAP-program ?
As a second solution I've tried the user import utility from the Portal, but somehow this doesn't let me import "customised information" fields.
Your help is much appreciated !
Hi,
Were you able to achieve this using abap code?
Regards,
Navya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I currently have the same issue (did you get an answer or solution D?), UME data source is ABAP (a dual stack system), we have implemented SSO to the Portal & need to keep the 'krb5principalname' field in the portal maintained with similar data to the 'USRACL' table in the ABAP side that is used for our SAPgui SSO.
Does anyone have some advice or good methods to automatically maintain the 'kbr5principalname' field in the J2EE side?
Regards
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Daniel,
No, I did not get an answer. I did manage to come up with another "solution".
It's not pretty, but it did the trick.
It reads a file from my local drive, which contains login name, e-mail address and kerberos name.
Please keep in mind that I'm no Portal developer ! and sorry for the dutch remarks.
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import com.sap.security.api.ISearchResult;
import com.sap.security.api.IUser;
import com.sap.security.api.IUserFactory;
import com.sap.security.api.IUserMaint;
import com.sap.security.api.IUserSearchFilter;
import com.sap.security.api.UMFactory;
import com.sapportals.portal.prt.component.AbstractPortalComponent;
import com.sapportals.portal.prt.component.IPortalComponentRequest;
import com.sapportals.portal.prt.component.IPortalComponentResponse;
public class UserInfoComponent extends AbstractPortalComponent
{
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
{
try {
// Open the file
FileInputStream fstream = new FileInputStream("c:\\dfltest.txt");
// Convert our input stream to a DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader buffer = new BufferedReader(new InputStreamReader(fstream));
// Schrijf kopregel
response.write("<table border=0>\n");
response.write("<tr><td>Inlognaam</td>\n");
response.write("<td>E-mailadres</td>\n");
response.write("<td>Kerberosnaam</td></tr>\n");
// Continue to read lines while there are still some left to read
String line;
while((line = buffer.readLine()) != null ) {
// while (in.available() !=0) {
// Splits regel op TAB-teken in velden inlognaam, emailadres en kerberosnaam
String[] regel =line.split("\t");
String inlognaam = regel[0];
String emailadres = regel[1];
String krb5name = regel[2];
// String[] regel = in.readLine().split("\t");
// String inlognaam = regel[0];
// String emailadres = regel[1];
// String krb5name = regel[2];
// Schrijf velden naar scherm
response.write("<tr><td>"+ inlognaam + "</td>\n");
response.write("<td>"+ emailadres + "</td>\n");
response.write("<td>"+ krb5name + "</td></tr>\n");
// In deze try gaan we de gebruiker proberen te updaten
try {
IUserFactory userFact = UMFactory.getUserFactory();
// Zoek gebruiker met inlognaam
String userId = inlognaam;
IUserMaint user = userFact.getMutableUser(
userFact.getUserByLogonID(userId).getUniqueID());
// Set het e-mail adres
user.setEmail(emailadres);
// Set de Kerberos inlognaam
String[] waarde = {krb5name};
user.setAttribute("com.sap.security.core.usermanagement", "krb5principalname", waarde);
// Save user data
user.commit();
}
catch (Exception e) {
}
}
// Sluit tabel af
response.write("</table>\n");
response.write("\n");
in.close();
fstream.close();
}
catch (Exception e){
System.err.println("File input error");
}
// Dit try/catch stukje loopt over alle users heen en geeft gegevens adres weer.
try
{
// Open Gebruikersfabriek
IUserFactory userfactory = UMFactory.getUserFactory();
// Maak zoekfilter
IUserSearchFilter userfltr = userfactory.getUserSearchFilter();
// Vul zoekfilter met gegevens (inlognaam, max hits)
// userfltr.setUniqueName("dafloor", ISearchAttribute.EQUALS_OPERATOR, true);
userfltr.setMaxSearchResultSize(5000);
// Zoek
ISearchResult userResult = userfactory.searchUsers(userfltr);
response.write("<table border=0>\n");
// Loop over resultaat
while (userResult.hasNext())
{
String uniqueid = (String) userResult.next();
// Haal gebruiker op
IUser user = userfactory.getUser(uniqueid);
// Geef gegevens weer --> naam
response.write("<tr><td bgcolor=Red>"+ user.getDisplayName()+ "</td>\n");
// Geef gegevens weer --> Kerberosnaam
String[] bla = user.getAttribute("com.sap.security.core.usermanagement","krb5principalname");
if (bla != null) {
for (int i=0; i<bla.length;i++) {
response.write("<td bgcolor=Orange>"+ bla<i> + "</td>\n");
}
}
else {
// Als geen kerberosnaam, dan leeg veld.
response.write("<td bgcolor=Orange></td>\n");
}
// Geef gegevens weer --> e-mailadres
response.write("<td bgcolor=Green>"+ user.getEmail()+ "</td></tr>\n");
}
// Sluit tabel af
response.write("</table>\n");
response.write("\n");
}
catch (Exception e) {
}
}
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.