Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
HuseyinBilgen
Active Contributor

In my recent blog (Why we use Amazon AWS as our SAP System Landscape), I gave our SAP Landscape information hosted on Amazon Cloud Services.

But, we do have On Premise Landscape in our office and we've ERP, CRM IDES, NetWeaver Solutions (Portal, PI, BPM in all releases) and Active Directory.

To manage the Identities in all systems is a big issue for us. So we decided to implement NetWeaver Identity Management (IdM) 7.20 for 2 reasons:

  1. To learn and setup a demo landscape for IdM
  2. To manage identitied for FIT Consulting

But we have to decide which system will be the leading system. We decided to use our email provider (Google Apps) accounts and assigned groups to decide the authentication and authorization for users.

For this, we need to read the accounts and assigned groups from Google Apps.

For this, we used Google Data Protocol (http://code.google.com/apis/gdata/)

Here is a code snipped attached to this blog written to read the Users and Assigned Groups from Google Apps. (Thanks Salih Atak for help in Coding)

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import sample.appsforyourdomain.AppsForYourDomainClient;
import com.google.gdata.client.appsforyourdomain.AppsGroupsService;
import com.google.gdata.data.appsforyourdomain.AppsForYourDomainException;
import com.google.gdata.data.appsforyourdomain.generic.GenericEntry;
import com.google.gdata.data.appsforyourdomain.generic.GenericFeed;
import com.google.gdata.data.appsforyourdomain.provisioning.UserEntry;
import com.google.gdata.data.appsforyourdomain.provisioning.UserFeed;
import com.google.gdata.util.ServiceException;
public class GoogleGetUsers {
          public static void main(String[] args) {
                    // TODO Auto-generated method stub
                    try {
                              AppsForYourDomainClient client =
                         new AppsForYourDomainClient("<serviceuser>@<domain>.com", "<password>", "<yourdomain.com>");
                              // To make calls to the groups provisioning, you need to obtain a
                              // groups service object from authenticated client:
                              if (new File("C:/GoogleApps/GoogleGetUsers.csv").exists() && !new File("C:/GoogleApps/GoogleGetUsers.csv").delete()){
                                        return;
                              }
                              FileWriter fstream = new FileWriter("C:/GoogleApps/GoogleGetUsers.csv", true);
                              BufferedWriter out = new BufferedWriter(fstream);
                              out.write("Username;Groups\n");
                              UserFeed usr = client.retrieveAllUsers();
                              AppsGroupsService groupsService = client.getGroupService();
                              String line = "";
                              for (UserEntry u : usr.getEntries()) {
                                        GenericFeed grup = groupsService.retrieveGroups(u.getId()
                                                            .substring(u.getId().lastIndexOf("/") + 1), true);
                                        for (GenericEntry g : grup.getEntries()) {
                                                  line = u.getId().substring(u.getId().lastIndexOf("/") + 1);
                                                  line += ";"
                                                                      + g.getId().substring(
                                                                                          g.getId().lastIndexOf("/") + 1,
                                                                                          g.getId().lastIndexOf("%"));
                                                  line += "\n";
                                                  out.write(line);
                                        }
                              }
                              out.close();
            } catch (AppsForYourDomainException e) {
                              e.printStackTrace();
                    } catch (ServiceException e) {
                              e.printStackTrace();
                    } catch (IOException e) {
                              e.printStackTrace();
                    } catch (Exception e) {
                              e.printStackTrace();
                    }

Whats Next?

Our next step will be to read the exported data and import into IdM to tirgger Provisioning Framework.

6 Comments
Labels in this area