Community contributed Extensions/Plugins/Adapters/VM

flag Questions

I had to built some oAuth with Phalcon. Then I share a simplified version of what i have done (i just put all the code in protected method of the controller, feel free to update the structure). You will have to modify a few things. Just look for "specific to your application" comments in the code. https://gist.github.com/SneakyBobito/6909234

It is based on PHPoAuthLib : https://github.com/Lusitanian/PHPoAuthLib then you have to add it to you autoloader Then you may add any service available in the lib (but i only tested with google and github). When you want to add a service : you have to generate an api key/secret key on the specific service and then put them into your config as with the examples of google and GitHub. Finaly add the action that has the same name of the oAuth service (github : GitHubAction google : GoogleAction)

All the examples of how to exploit the oAuth api are here : https://github.com/Lusitanian/PHPoAuthLib

$di['mail'] = function () use ($cf) {
$mail = new PHPMailer;

$mail->isSMTP();
$mail->isHTML(true);

$mail->CharSet      = $cf->mail->charset;                                
$mail->Host         = $cf->mail->host;
$mail->SMTPAuth     = true;                               
$mail->Username     = $cf->mail->username;               
$mail->Password     = $cf->mail->password;                           
$mail->SMTPSecure   = $cf->mail->security;    
$mail->Port         = $cf->mail->port;

$mail->addAddress($cf->mail->email, $cf->mail->name);

return $mail;
};
in progress
Jun 7/15 at 08:01 2 Answers 21 Views 0

About the Author

I had to built some oAuth with Phalcon. Then I share a simplified version of what i have done (i just put all the code in protected method of the controller, feel free to update the structure). You will have to modify a few things. Just look for "specific to your application" comments in the code. https://gist.github.com/SneakyBobito/6909234 It is based on PHPoAuthLib : https://github.com/Lusitanian/PHPoAuthLib then you have to add it to you autoloader Then you may add any service available in the lib (but i only tested with google and github). When you want to add a service : you have to generate an api key/secret key on the specific service and then put them into your config as with the examples of google and GitHub. Finaly add the action that has the same name of the oAuth service (github : GitHubAction google : GoogleAction) All the examples of how to exploit the oAuth api are here : https://github.com/Lusitanian/PHPoAuthLib

Answers ( 2 )

    0
    Jun 8/15 at 03:00

    I had to built some oAuth with Phalcon. Then I share a simplified version of what i have done (i just put all the code in protected method of the controller, feel free to update the structure). You will have to modify a few things. Just look for "specific to your application" comments in the code.

    0
    Jun 8/15 at 02:03

    I had to built some oAuth with Phalcon. Then I share a simplified version of what i have done (i just put all the code in protected method of the controller, feel free to update the structure). You will have to modify a few things. Just look for "specific to your application" comments in the code. https://gist.github.com/SneakyBobito/6909234

Leave a reply

 Prev question

Next question