Skip to content

Instantly share code, notes, and snippets.

@itayher
Last active April 18, 2016 12:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itayher/8da4e7f6540abe202d0db256f3ca1b23 to your computer and use it in GitHub Desktop.
Save itayher/8da4e7f6540abe202d0db256f3ca1b23 to your computer and use it in GitHub Desktop.

###Basic Auth To use Admin's permission in the server side action or imperonsate to other user use basic auth Authorization header:

###Back& server side Action In the action change the headers code to be this line:

headers:{'Authorization':'basic ' + btoa (username + ':'+ password) }

The username is the app master token (Securit & Auth /social &keys).

The password is the Admin user key (Team / key Icon near the username).

###The entrie code should look like this:

var response = $http({ 
      method: "POST", url:CONSTS.apiUrl + "/1/objects/users",
      params: {parameters: {"sync": true}}, 
      data: parameters, 
      headers:{'Authorization':'basic ' + btoa (username + ':'+ password) } 
});

###cURL Example###

curl https://api.backand.com/1/objects/items -u 517f8654-eadd-478b-a65b-66dd5625458e:27b90578-c2dc-11e5-be83-0ed7053426cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment