We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

generating Signature Base String for Oauth - problem with url

Hi,

I need to generate Signature Base String for Oauth1 and I need my url for this. Url should be in format schema://user:[email protected]:8042. Is there any simple possibility to get it (or the parts of it) simply?

Kathy

P.S. "Use Phalcon Request and $_SERVER)" is not answer for me. I didn't find the way to get it, which is not complicated.



98.9k
edited Aug '14

Sometime ago I made use of oauth_get_sbs for this purpose, this extension is available on pecl

Well... It's not about how to get Signature Base String (SBS).... The problem is how to get url part for SBS in Phalcon.



98.9k

You can use Phalcon\Http\Request:

$host = $this->request->getHttpHost();

or

$host = $this->request->getScheme() . '://' . this->getServer("SERVER_NAME")  . ':' .  this->getServer("SERVER_PORT") ;