PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Security/Firewall/FacebookListener.php

http://github.com/FriendsOfSymfony/FOSFacebookBundle
PHP | 29 lines | 13 code | 5 blank | 11 comment | 0 complexity | 3c555907ad05d30c5c37f6f43d2877ef MD5 | raw file
 1<?php
 2
 3/*
 4 * This file is part of the FOSFacebookBundle package.
 5 *
 6 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
 7 *
 8 * For the full copyright and license information, please view the LICENSE
 9 * file that was distributed with this source code.
10 */
11
12namespace FOS\FacebookBundle\Security\Firewall;
13
14use FOS\FacebookBundle\Security\Authentication\Token\FacebookUserToken;
15use Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener;
16use Symfony\Component\HttpFoundation\Request;
17
18/**
19 * Facebook authentication listener.
20 */
21class FacebookListener extends AbstractAuthenticationListener
22{
23    protected function attemptAuthentication(Request $request)
24    {
25        $accessToken = $request->get('access_token');
26
27        return $this->authenticationManager->authenticate(new FacebookUserToken($this->providerKey, '', array(), $accessToken));
28    }
29}