I'd like to build an UDA in Nintex Workflows which uses a SharePoint REST API.
In fact, this one : Social feed REST API reference for SharePoint 2013
I've achieved this but I needed to explicitly specify an account to call the Web Request. To be fully functional, I have to be able to pass credentials of the initiator of the workflow.
Example : "Post a message in Newsfeed" would be more logical if the initiator was the author of the post.
I don't know how to achieve this. Any suggestions?
Thanks in advance !
The feature you are asking for is understandable but it opens a door to workflows that do exactly what you would hate on Facebook : Apps publishing on your behalf without any manual actions from you!!
To use any WebService interface you have to explicitly specify credentials in the Call WebService Action! You cannot call a webservice using the credentials of the current user. I have tried to find a workaround but there are not.
If it is really mandatory for you, you can still develop your own activity, but that is not what I would advice you to do!
Thank you for your investigations.
In this case, I will do my action with a specific account. Development must be avoided in my context.
What you think about the questionable behavior is valid for this specific action. Consider other needs, sharing the same authentication process. For example writing in a specific back office application in which information confidentiality must be preserved. This could be done via the same Web Request action if it provides a way to use current credentials.
If I do get you right you achieved to post into a newsfeed by nintex workflow. Your problem is that this only works with a specific account and not in the name of a user you want to set as author. Right?
Would you be so nice to share your solution with us? I would be very pleased! :-)
And for your problem this could be a solution as far as you got the credentials of the user in which name you want to post - you can run a workflow in the name of another person. Vadim Tabakman:
Nintex Workflow comes with a web service. Here's some more info from a colleague of mine (Simon Wright) - http://sharepointed.info/ever-wondered-about-nintex-workflow-web-services/
Part of that web service, is that it exposes two important web methods for impersonation. StartWorkflow, StartWorkflowOnListItem and StartSiteWorkflow. These allow you to start a workflow on an item, document or a Site. The Call Web Service action in Nintex Workflow lets you put n credentials. In effect, you could have a parent workflow start on an event, and then use the Call Web Service action to start a child workflow as a different user. As long as you have their credentials. Most likely in this scenario, you'll be creating a Nintex Workflow Constant (credential) and use that in the Call Web Service action.
Unfortunately, this requirement has been realized in a proof of concept. Project has never started.
And it was built on my customer's platform.
But as far as I remember, you just have to build the expected data string and send it to the web method.
'ContentText':'This post was published using REST.',
And I know that I'm able to use specific credentials to call web service but my need was really to call it via current user credentials.