cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

SPServices, Nintex, and Claims Based Auth

Jump to solution

Hi all,

Has any of you recently used SPServices with Nintex Forms and Claims Based Auth? I am having trouble with it.

Particularly, it cannot seem to get any data from the User Profile Service.

I noticed that the username it gets when querying account names programatically is of the format i#0:<domain>:<username> (or something of the like). I thought this was the problem so I just changed it back to <domain>:<username>.

The code I'm using is similar to this one:

// Query the User Profile Service for the current user's manager
NWF$(document).ready(function() {
  var ManagerAccount;

  NWF$().SPServices({  operation: "GetUserProfileByName",  async: false,    AccountName: NWF$().SPServices.SPGetCurrentUser(),


  completefunc: function (xData, Status) {
  ManagerAccount = getUPValue(xData.responseXML, "Manager");
  }
  });

  // Initialise Manager People picker control  var managerPicker = new NF.PeoplePickerWrapper('.manager-control input');


  managerPicker.ready(function () {
  });
});

// ****************************************************
// Function to retrieve User Properties
// ****************************************************

function getUPValue(x, p) {
  var thisValue = NWF$(x).SPFilterNode("PropertyData").filter(function() {
  return NWF$(this).find("Name").text() == p;
  }).find("Values").text();
  return thisValue;
}

  //search for Manager Name and add first search result  managerPicker.search(ManagerAccount).done(function (data) {  managerPicker.add(data[0]);  });

Thank you!

Labels: (3)
0 Kudos
Reply
5 Replies
Highlighted
Automation Master
Automation Master

Re: SPServices, Nintex, and Claims Based Auth

Jump to solution

Nintex Forms works very well with claims authentication. And i#0: is the how a claim is formatted in SharePoint for user information and should be expected.

It appears you are trying to get the current users manager and make this account the default value of a people picker. Am I reading your code correctly?

View solution in original post

0 Kudos
Reply
Highlighted
Not applicable

Re: SPServices, Nintex, and Claims Based Auth

Jump to solution

Yes, that is exactly what I am doing

When I use the Nintex Runtime Function (queryuserprofile), it works wonders.

Also, the same code above works for traditional SharePoint auth (not claims-based).

Do you have an idea what is the problem?

Thank you!

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: SPServices, Nintex, and Claims Based Auth

Jump to solution

Print out ManagerAccount first into a an alert() to make sure you are getting that far before attempting to put into the people picker. What is your result?

0 Kudos
Reply
Highlighted
Not applicable

Re: SPServices, Nintex, and Claims Based Auth

Jump to solution

Hi Andrew,

I think I figured out the problem. The SPServices was working, just that the User Profile property doesn't contain anything.

Thanks!

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: SPServices, Nintex, and Claims Based Auth

Jump to solution

Good that you found that. That was my intention to start breaking down the values to see what was there. To benefit the community, would you mind posting your final solution? Also, feel free to mark your own answer as correct.

Reply