cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

PostJSON with user authentication

Highlighted
Regular Member

PostJSON with user authentication

I am looking for a sample code invoking PostJSON service with user authentication across session.

i.e Once user is authenticated during first use(login) subsequent REST calls should use the current user(session user) &password.

How do i pass the username & password to PostJSON, dynamically by taking it from the current session

var params = {

proxyScheme: undefined /* STRING */,

headers: undefined /* JSON */,

ignoreSSLErrors: undefined /* BOOLEAN */,

useNTLM: undefined /* BOOLEAN */,

workstation: undefined /* STRING */,

useProxy: undefined /* BOOLEAN */,

withCookies: undefined /* BOOLEAN */,

proxyHost: undefined /* STRING */,

url: undefined /* STRING */,

content: undefined /* JSON */,

timeout: undefined /* NUMBER */,

proxyPort: undefined /* INTEGER */,

password: sessionpassword?? /* STRING */,

domain: undefined /* STRING */,

username: sessionuser?? /* STRING */

};

Tags (2)
1 REPLY 1

Re: PostJSON with user authentication

I've done this with Salesforce.. Using PostJSON to get a session token and then using it in subsequent services.  It will depend on the API of the site you're authenticating with though.  Here's my example:

Connecting to Salesforce with ThingWorx - EAC Product Development Solutions

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________