Page 1 of 1

Help generate Authorization header for Stackmob!

Posted: Wed Nov 20, 2013 12:46 am
by Kerm

How do I generate an authentication header like this for the Stackmob OAuth 2.0 API?

https://developer.stackmob.com/rest-a...

I've got the mackey and accesstoken stored but I have no idea how to write the script for the Authorization header, if you could do this it would be much appreciated and help those who wish to integrate Stackmob with Appery.io too!


Help generate Authorization header for Stackmob!

Posted: Wed Nov 20, 2013 1:24 am
by Alena Prykhodko

Help generate Authorization header for Stackmob!

Posted: Wed Nov 20, 2013 1:28 am
by Kerm

That's oAUTH 1.0, I need 2.0.


Help generate Authorization header for Stackmob!

Posted: Wed Nov 20, 2013 1:50 am
by maxkatz

We don't have an example but they show the steps in here (same link you provided above): https://developer.stackmob.com/rest-a.... It is just using JavaScript, there is nothing specific to Appery.io


Help generate Authorization header for Stackmob!

Posted: Wed Nov 20, 2013 1:59 am
by Kerm

It'd be great if you could provide the script since it's relatively hard to generate, the StackmobJS sample doesn't help as it includes the StackmobJS SDK.


Help generate Authorization header for Stackmob!

Posted: Wed Nov 20, 2013 1:34 pm
by Maryna Brodina

Hello! To create Login service for StackMob you have to create REST service:

URL: https://api.stackmob.com/user/accessT...
Method: POST
Content Type: x-www-form-urlencoded

with the following request parameters:
1) "X-StackMob-API-Key" - API key value (you can get it here https://dashboard.stackmob.com/login?...), check Header
2) "X-StackMob-User-Agent" - SDK Version (according to documentation http://stackmob.com/), check Header
3) "Content-Type" - constant value "application/x-www-form-urlencoded", check Header
4) "Accept" - constant value "application/vnd.stackmob+json; version=0", check Header
5) "username"
6) "password"
Should be like on the screenshot

Image and here is the Test tab
Image


Help generate Authorization header for Stackmob!

Posted: Thu Nov 21, 2013 4:21 am
by Kerm

Hi There,
I've already done the above, however the trouble is signing requests using oAuth 2


Help generate Authorization header for Stackmob!

Posted: Thu Nov 21, 2013 4:33 am
by Igor

Hello,

What exactly trouble?
Please show us error code or screenshot with error!


Help generate Authorization header for Stackmob!

Posted: Thu Nov 21, 2013 4:34 am
by Kerm

I need my requests signed like this:
https://developer.stackmob.com/rest-a...

I don't know how to.


Help generate Authorization header for Stackmob!

Posted: Thu Nov 21, 2013 4:42 am
by maxkatz

Have you tried StackMob support..? it's their API, I'd think will be able to help you quicker.