git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inject Authorization Header into WebView on Mobile


Hi Bill,

Just to make sure I got it right:
Do you want to call a PHP page which renders some HTML which is sent back to
the client in order to display it in the browser?
And in order to access the PHP page, Basic Auth is needed?

If so, just some thoughts:
- In order to call the PHP page, you probably have to call an URL via HTTP.
- Because it's just an HTTP request you should be able to add a "Basic Auth
header" to this request
- You can build this header by yourself
- The key for the header is "Authorization"
- The value is just a string with the leading string "Basic", followed by
username and password: "Basic username:password"
- The important thing is that "username:password" has to be encoded as
base64!
- AS3 with e.g. HTTPService [1] as well as JS with XMLHttpRequest [2]
supported the sending of custom headers

I don't know anything about ANE's and I've no idea how do you pass the URL
to the mentioned ANE or how do you let the ANE make the request.
But I've read that "Full communication between Javascript and Actionscript"
is supported by this Rich Webview.
So, I guess it should be possible to construct anything that is needed on
AS3 side and pass it to the JS side and let the JS side make the request.
Another way could be to make the HTTP call on AS3 side in order to fetch the
generated HTML and pass it to the ANE, not sure.

Please notice that I am not so experienced with this ANE/WebView stuff...so
HTH!

Good luck!
Olaf

[1]
https://help.adobe.com/de_DE/FlashPlatform/reference/actionscript/3/mx/rpc/http/HTTPService.html
[2] https://developer.mozilla.org/de/docs/Web/API/XMLHttpRequest
 






--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/