Initiator credentials in a Web Request Action

  • 16 June 2015
  • 8 replies
  • 77 views

Badge +7

Hi,

 

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 !

Regards


8 replies

Badge +6

Hi Pierre,

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!

Alex

Badge +7

Hi Alexandre,

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.

Badge +7

I found this on uservoice :

Run workflow actions under current user – Customer Feedback for Nintex

Alex Burton​, is this available for an on premise context?

Badge +7

This idea on uservoice is more related to my question :

Call web service with the credentials of the initiator – Customer Feedback for Nintex

Badge +2

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.

Badge +7

Hi Philipp,

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.

{

   'restCreationData':{

   '__metadata':{

   'type':'SP.Social.SocialRestPostCreationData'

  },

   'ID':null,

   'creationData':{

   '__metadata':{

   'type':'SP.Social.SocialPostCreationData'

  },

   'ContentText':'This post was published using REST.',

   'UpdateStatusText':false

  }

  }

  }

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.

Badge +2

Thanks for the code!

Ok, current user credentials would be a problem, that's right... so no solution for this right now.

Badge +3
I know this was some time ago but does this code set the workflow to use the credentials of the initiator? If so could you assist me in adding this process to my workflow?

You said build a string and send to webmethod? How would I achieve this?

Reply