6 Replies Latest reply on Sep 19, 2014 9:59 AM by Prem Reddy

    is it possible to get the group of a user in the response xml while making HTTPPost request to login.xml?

    Dipankar Ghosal

      I am using HTTPClient to authenticate a user (simulating SSO).

      I have used the below code

      // Create a post request for the authentication

              HttpPost postrequest = new HttpPost(serveraddress + "/auth/login.xml");

       

              // Fill in parameters

              List<NameValuePair> nvps = new ArrayList<NameValuePair>();

              nvps.add(new BasicNameValuePair("authenticity_token", authencity_token));

              nvps.add(new BasicNameValuePair("crypted", cryptedpass));

              nvps.add(new BasicNameValuePair("username", user));

              //nvps.add(new BasicNameValuePair("target_site", "hispanic_segment_behavior"));

             

             

              //System.out.println("Username ::"+user);

       

              // bind parameters to the request

              postrequest.setEntity(new UrlEncodedFormEntity(nvps));

       

              HttpResponse postResponse = client.execute(postrequest);

       

      The response does not contain the group of the user.

       

      The response that I get is

      <?xml version="1.0" encoding="UTF-8"?>

      <successful_login>

          <user>

              <id>98</id>

              <site_prefix>/t/hispanic_segment_behavior</site_prefix>

              <site_namespace>hispanic_segment_behavior</site_namespace>

              <site_displayname>Hispanic Segment Behavior</site_displayname>

              <site_quota_enabled>false</site_quota_enabled>

              <name>local\impetus</name>

              <friendly_name>Impetus Report Access</friendly_name>

              <login_at>2013-12-04 09:59:01 UTC</login_at>

              <email></email>

              <licensing_level>Viewer</licensing_level>

              <administrator>false</administrator>

              <admin_type></admin_type>

              <publisher>false</publisher>

              <raw_data_suppressor>false</raw_data_suppressor>

              <quotas>

                  <row_limit></row_limit>

                  <storage_limit>50000000</storage_limit>

                  <storage_used>0</storage_used>

                  <storage_available>50000000</storage_available>

                  <extracts_required>1</extracts_required>

                  <allowed_connections>

                  </allowed_connections>

              </quotas>

          </user>

          <settings>

              <allow_content_admins>true</allow_content_admins>

              <allow_scheduling>true</allow_scheduling>

              <do_not_reap_extracts_before>0</do_not_reap_extracts_before>

              <embedded_credentials>true</embedded_credentials>

              <emergency_perf_mode>false</emergency_perf_mode>

              <enable_guest>false</enable_guest>

              <extract_engine_enabled>true</extract_engine_enabled>

              <language_id>en</language_id>

              <locale_id>en_US</locale_id>

              <managed_keychains>true</managed_keychains>

              <motd></motd>

              <remember_passwords_forever>false</remember_passwords_forever>

              <start_page_uri></start_page_uri>

              <webops_allow_new_account_signup>true

              </webops_allow_new_account_signup>

              <webops_allow_publishing>true</webops_allow_publishing>

              <webops_backup_mode>false</webops_backup_mode>

              <webops_maintenance_mode>false</webops_maintenance_mode>

              <view_display_setting>name</view_display_setting>

              <sspi_setting>false</sspi_setting>

          </settings>

          <authenticity_token>3FzBsATNRDxVEeROnyhVGoO/EUMdqabhRPAtqHDW0jI=

          </authenticity_token>

      </successful_login>

       

       

      I need to know the group to which this user is associated. Is there any way to get the user's group. We need this info to fetch relevant data for the given user and group.

       

      Thanks,

      Dipankar