I'm running PHP 5.3.6 as Apache 2 module (phpinfo ServerAPI says "Apache 2.0 Filter") in a Ubuntu machine. I have a PHP application and I want a iOS client to send it information under https. Concretely, I want to send a oAuth2 token in Authorization header, using:
Authorization: Bearer XXXXXXXXX
Being XXXXXXXXX the Base64 encoding of a oAuth2 token.
The request is sent from the iOS client properly (I can see the request header with my Authorization string), and I can see it when it reachs the server by executing getallheaders.
My problem is I don't know if I'm being conceptually correct. When I use Basic authentication, I can get user and password by $_SERVER['PHP_AUTH_USER"] and $_SERVER['PHP_AUTH_PW']. But here, I'm getting just the raw 'Authorization' value of the array that getallheaders returns. Sounds like 'dirty' to me.
Is there another different way of getting the token in my server? I just want to store it in a database, and use it later to make API calls to the token provider on behalf of my clients.
Many thanks in advance, and best regards