[TYPO3-dev] Extension callback URL generation
Dmitry Dulepov
dmitry.dulepov at gmail.com
Wed May 18 13:27:25 CEST 2011
Hi!
Conor Hackett wrote:
> I'm working on an extension for a web service that uses OAuth2. I need
> to be able to provide a callback url to the service.
>
> I've read on here that I can use an explicit url to a PHP script in my
> extensions directory.
>
> e.g. http://127.0.0.1/typo3/typo3conf/ext/my_plugin/pi1/callback.php
Not gonna work in some environments where you can't access php files
directly inside typo3conf/ due to security settings.
You will be better with eID.
> I'm thinking the best way would be construct the url using in php and
> output to the user on the setup page. The following code:
>
> t3lib_div::getThisUrl().'typo3conf/ext/ch_guestbook/pi1/callback.php
Never ever! Right way:
t3lib_div::locationHeaderUrl(t3lib_extMgm::siteRelPath('ch_guestbook'),
'path/inside/the/ext')
But you still be better with eID.
> This script will then take the code provided in the callback ($_GET) and
> save it as a setting (salted & encrypted).
Not $_GET but t3lib_div::_GET()!
--
Dmitry "itoldyou" Dulepov
TYPO3 core&security team member
E-mail: dmitry.dulepov at typo3.org
Web: http://dmitry-dulepov.com/
More information about the TYPO3-dev
mailing list