Copy link to clipboard
Copied
I have a .swf made from an AIR project that makes https request to a REST api (i.e. Parse.com)
There is no problem running this .swf with AIR.
If I were to run this .swf in regular Flash player 11, I encounter:
GET request I receive error 401 (unauthorized)
POST request there is no problem.
Is this expected?
Copy link to clipboard
Copied
not because of anything on the flash side. if you had a flash problem it would be a security sandbox error and would occur with post and get.
check that rest api to see if it allows get requests.
Copy link to clipboard
Copied
I should clarify that GET is allowed, because if I run the exact same .swf with the ADL instead of Flash player 11, both GET and POST requests succeed.
In addition to Parse.com, I also tried Stackmob.com's REST api. Similar results:
http://support.stackmob.com/entries/27724236-Invalid-OAuth-credentials-or-signature-Key-not-provided
But works fine if launched in ADL.
I'm here because these REST api companies do not support as3 and can't help.
Copy link to clipboard
Copied
copy and paste a simplified get actionscript request that fails and a javascript request that suceeds.
Copy link to clipboard
Copied
How do you perform authentication? Without seeing your code this is a guess in the dark, but one of the limitations with GET in the browser plugin is that it cannot send basic auth headers. Only POST can. In AIR you aren't subject to this limitation.
-Aaron
Copy link to clipboard
Copied
I uploaded a FlashDevelop AIR project.
http://temp-share.com/show/3Yg8b3Qnx/a956b800e1d5ac09a2b7a92d6ffbdc95
Main class is StackMobTest.as, (managed by application.xml)
it depends on the included
com.cycleit.stackmobconn package
and
as3crypto.swc for user authentication (though not used in this example)
The built .swf in
/bin/stackmob.swf
does a GET on an entirely public access schema named 'blogentry' and prints to console:
If launching with FlashPlayer 11:
[Starting debug session with FDB]
{"error":"Invalid OAuth credentials or signature: Key not provided"}
If launching with ADL:
[Starting debug session with FDB]
[{"lastmoddate":1381449318701,"createddate":1381449318701,"text":"test string","blogentry_id":"blogentry1"},{"lastmoddate":1381449332754,"createddate":1381449332754,"text":"test string","blogentry_id":"blogentry2"}]
{"createddate":1381449344126,"lastmoddate":1381449344126,"blogentry_id":"e94f6d54d7fb43a49c80e68f2ae436f4","message":"SM AS3 SDK 0.0.1 Test"}
{"createddate":1381449344126,"lastmoddate":1381449344126,"blogentry_id":"e94f6d54d7fb43a49c80e68f2ae436f4","message":"SM AS3 SDK 0.0.1 Test"}
{"createddate":1381449344126,"lastmoddate":1381449344715,"blogentry_id":"e94f6d54d7fb43a49c80e68f2ae436f4","message":"Updated Message for AS3 SDK!"}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now