public function register(Application $app)
    {
        $app['social-login.controller'] = $app->share(function ($app) {
            $config = $app['config']->load('social-login');

            $controller = new SocialLoginController;
            $controller
                ->setSocialLoginService($app['social-login.service'])
                ->setConfig($config)
                ->setServiceFactory(new ServiceFactory())
                ->setSession($app['session']);

            return $controller;
        });

        $app['social-login.mapper'] = $app->share(function ($app) {
            return new SocialLoginMapper($app['db'], new SocialLoginEntity);
        });

        $app['social-login.service'] = $app->share(function ($app) {
            $service = new SocialLoginService;
            $service->setUserService($app['user.service'])
                ->setSocialLoginMapper($app['social-login.mapper'])
                ->setOAuthStorage($app['oauth.storage']);

            return $service;
        });

        $app->get('/social-login/{provider}', 'social-login.controller:login')
            ->bind('social-login-auth');

        $app->get('/social-login/{provider}/link', 'social-login.controller:link')
            ->bind('social-link-auth');

        $app->get('/social-login/{provider}/callback', 'social-login.controller:callback')
            ->bind('social-login-callback');

        $this->setFirewalls($app);
    }