Permalink
Browse files

Login through sensiolabs connect/github

references #44
  • Loading branch information...
inmarelibero committed Nov 28, 2013
1 parent 8ac1370 commit d36e04a3a747f07f56ff8be6774a0a266b4a95c1
Showing with 2,633 additions and 130 deletions.
  1. +4 −0 app/AppKernel.php
  2. +4 −3 app/config/config.yml
  3. +21 −0 app/config/hwi_oauth.yml
  4. +3 −0 app/config/parameters.yml.dist
  5. +23 −0 app/config/routing.yml
  6. +15 −2 app/config/security.yml
  7. +2 −1 composer.json
  8. +115 −2 composer.lock
  9. +16 −0 src/Bricks/HWIOAuthBundle/BricksHWIOAuthBundle.php
  10. +28 −0 src/Bricks/HWIOAuthBundle/DependencyInjection/BricksHWIOAuthExtension.php
  11. +29 −0 src/Bricks/HWIOAuthBundle/DependencyInjection/Configuration.php
  12. +20 −0 src/Bricks/HWIOAuthBundle/Resources/config/services.xml
  13. +29 −0 src/Bricks/HWIOAuthBundle/Resources/views/Connect/connect_confirm.html.twig
  14. +11 −0 src/Bricks/HWIOAuthBundle/Resources/views/layout.html.twig
  15. +121 −0 src/Bricks/MessageBundle/Entity/Message.php~
  16. +80 −0 src/Bricks/MessageBundle/Entity/MessageMetadata.php~
  17. +153 −0 src/Bricks/MessageBundle/Entity/Thread.php~
  18. +79 −0 src/Bricks/MessageBundle/Entity/ThreadMetadata.php~
  19. +528 −0 src/Bricks/SiteBundle/Entity/Brick.php~
  20. +102 −0 src/Bricks/SiteBundle/Entity/BrickHasTag.php~
  21. +137 −0 src/Bricks/SiteBundle/Entity/BrickLicense.php~
  22. +227 −0 src/Bricks/SiteBundle/Entity/BrickLogEntry.php~
  23. +150 −0 src/Bricks/SiteBundle/Entity/Tag.php~
  24. +162 −0 src/Bricks/SiteBundle/Entity/UserStarsBrick.php~
  25. +2 −0 src/Bricks/SiteBundle/Resources/public/less/layout.less
  26. +83 −82 src/Bricks/UserBundle/Entity/User.php
  27. +153 −0 src/Bricks/UserBundle/Entity/User.php~
  28. +31 −1 src/Bricks/UserBundle/Form/Type/ProfileFormType.php
  29. +7 −0 src/Bricks/UserBundle/Resources/config/services.xml
  30. +69 −4 src/Bricks/UserBundle/Resources/public/less/security.less
  31. +9 −2 src/Bricks/UserBundle/Resources/translations/FOSUserBundle.en.yml
  32. +9 −2 src/Bricks/UserBundle/Resources/translations/FOSUserBundle.es.yml
  33. +9 −2 src/Bricks/UserBundle/Resources/translations/FOSUserBundle.it.yml
  34. +5 −0 src/Bricks/UserBundle/Resources/translations/UserBundle.en.yml
  35. +5 −0 src/Bricks/UserBundle/Resources/translations/UserBundle.es.yml
  36. +5 −0 src/Bricks/UserBundle/Resources/translations/UserBundle.it.yml
  37. +12 −0 src/Bricks/UserBundle/Resources/views/Default/dashboard.html.twig
  38. +56 −29 src/Bricks/UserBundle/Resources/views/Security/login.html.twig
  39. +119 −0 src/Bricks/UserBundle/Security/Core/User/FOSUBUserProvider.php
  40. BIN web/img/GitHub_Logo.png
  41. BIN web/img/SensioConnect_logo.png
View
@@ -50,13 +50,17 @@ public function registerBundles()
// EkoFeedBundle
new Eko\FeedBundle\EkoFeedBundle(),
// HWIOAuthBundle
new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
// Bricks bundles
new Bricks\SiteBundle\BricksSiteBundle(),
new Bricks\WikiBundle\BricksWikiBundle(),
new Bricks\UserBundle\BricksUserBundle(),
new Bricks\MessageBundle\BricksMessageBundle(),
new Bricks\RedirectBundle\BricksRedirectBundle(),
new Bricks\RSSBundle\BricksRSSBundle(),
new Bricks\HWIOAuthBundle\BricksHWIOAuthBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
View
@@ -1,8 +1,9 @@
imports:
- { resource: parameters.yml }
- { resource: assetic.yml }
- { resource: locales.yml }
- { resource: security.yml }
- { resource: assetic.yml }
- { resource: locales.yml }
- { resource: security.yml }
- { resource: hwi_oauth.yml }
parameters:
locale: en #default locale
View
@@ -0,0 +1,21 @@
hwi_oauth:
firewall_name: main
connect:
account_connector: bricks.user_provider
# optional FOSUserBundle integration
fosub:
# try 30 times to check if a username is available (foo, foo1, foo2 etc)
username_iterations: 30
properties:
# these properties will be used/redefined later in the custom FOSUBUserProvider service.
github: githubId
resource_owners:
github:
type: github
client_id: %oauth_github_client_id%
client_secret: %oauth_github_client_secret%
scope: "user:email"
@@ -19,3 +19,6 @@ parameters:
admin:
mail_address: -
# oauth apps parameters
oauth_github_client_id: xxxxx
oauth_github_client_secret: xxxxx
View
@@ -1,3 +1,8 @@
bricks_hwio_auth:
resource: "@BricksHWIOAuthBundle/Controller/"
type: annotation
prefix: /
# BricksRedirectBundle controllers are loaded before any other
bricks_redirect:
resource: "@BricksRedirectBundle/Controller/"
@@ -113,6 +118,24 @@ PrestaSitemapBundle:
resource: "@PrestaSitemapBundle/Resources/config/routing.yml"
prefix: /
# HWIOAuthBundle
hwi_oauth_security:
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
prefix: /login
hwi_oauth_connect:
resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml"
prefix: /connect
hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect
github_login:
pattern: /login/check-github
sensio_connect_login:
pattern: /login/check-sensio-connect
# AvalancheImagineBundle
_imagine:
resource: .
View
@@ -9,15 +9,28 @@ security:
firewalls:
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_provider: form.csrf_provider
login_path: fos_user_security_login
check_path: fos_user_security_check
oauth:
resource_owners:
github: "/login/check-github"
login_path: /login
failure_path: /login
oauth_user_provider:
service: bricks.user_provider
logout:
path: logout
target: /
path: logout
target: /
anonymous: true
remember_me:
key: "%secret%"
lifetime: 31536000 # 365 days in seconds
View
@@ -31,7 +31,8 @@
"pk/markdownify-bundle": "2.1.*",
"vich/uploader-bundle": "dev-master",
"avalanche123/imagine-bundle": "v2.1",
"eko/feedbundle": "1.0.*@dev"
"eko/feedbundle": "1.0.*@dev",
"hwi/oauth-bundle": "0.3.*@dev"
},
"scripts": {
"post-install-cmd": [
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,16 @@
<?php
namespace Bricks\HWIOAuthBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class BricksHWIOAuthBundle extends Bundle
{
/**
* extends HWIOAuthBundle
*/
public function getParent()
{
return 'HWIOAuthBundle';
}
}
@@ -0,0 +1,28 @@
<?php
namespace Bricks\HWIOAuthBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class BricksHWIOAuthExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
}
@@ -0,0 +1,29 @@
<?php
namespace Bricks\HWIOAuthBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('bricks_hwio_auth');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}
@@ -0,0 +1,20 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<!--
<parameters>
<parameter key="bricks_hwio_auth.example.class">Bricks\HWIOAuthBundle\Example</parameter>
</parameters>
<services>
<service id="bricks_hwio_auth.example" class="%bricks_hwio_auth.example.class%">
<argument type="service" id="service_id" />
<argument>plain_value</argument>
<argument>%parameter_name%</argument>
</service>
</services>
-->
</container>
Oops, something went wrong.

0 comments on commit d36e04a

Please sign in to comment.