Permalink
Browse files

Implemented social auth

- Enabled github, google, and twitter
  • Loading branch information...
weierophinney committed Nov 14, 2012
1 parent 0cb3989 commit 7d6b9846603c9dce31e27ef7bebb06280cc19f05
View
@@ -21,5 +21,7 @@ vendor/composer
vendor/phly
vendor/zendframework
vendor/zf-commons
+vendor/hybridauth
+vendor/socalnick
.*.sw*
.*.un~
View
@@ -21,6 +21,8 @@ mwop=/home/matthew/git/sites/mwop CD=. filter="README TODO.md *.php *.xml *.txt
module.phly-contact.global.php
module.phly-contact.local.php
module.zfcuser.global.php
+ scn-social-auth.global.php
+ scn-social-auth.local.php
}
}
content=content {
View
@@ -10,6 +10,6 @@
"phly/phly-blog": "dev-master",
"phly/phly-contact": "dev-master",
"zendframework/zendservice-recaptcha": "2.*",
- "zf-commons/zfc-user": "dev-master"
+ "socalnick/scn-social-auth": "dev-master"
}
}
View

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

Oops, something went wrong.
@@ -7,6 +7,7 @@
'PhlyBlog',
'PhlyComic',
'PhlyContact',
+ 'ScnSocialAuth',
'ZfcBase',
'ZfcUser',
),
@@ -1,24 +1,12 @@
<?php
-$dbParams = array(
- 'dsn' => 'sqlite:' . getcwd() . '/data/users.db',
- 'database' => '',
- 'username' => '',
- 'password' => '',
- 'hostname' => '',
-);
return array(
+ 'db' => array(
+ 'driver' => 'Pdo_Sqlite',
+ 'database' => getcwd() . '/data/users.db',
+ ),
'service_manager' => array(
'factories' => array(
- 'Zend\Db\Adapter\Adapter' => function ($sm) use ($dbParams) {
- return new Zend\Db\Adapter\Adapter(array(
- 'driver' => 'pdo',
- 'dsn' => $dbParams['dsn'],
- 'database' => $dbParams['database'],
- 'username' => $dbParams['username'],
- 'password' => $dbParams['password'],
- 'hostname' => $dbParams['hostname'],
- ));
- },
+ 'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory',
),
),
);
@@ -23,7 +23,7 @@
*
* Accepted values: boolean true or false
*/
- 'enable_registration' => false,
+ 'enable_registration' => true,
/**
* Enable Username
@@ -33,7 +33,7 @@
*
* Accepted values: boolean true or false
*/
- 'enable_username' => true,
+ 'enable_username' => false,
/**
* Enable Display Name
@@ -43,7 +43,7 @@
*
* Accepted values: boolean true or false
*/
- 'enable_display_name' => true,
+ 'enable_display_name' => false,
/**
* Modes for authentication identity match
@@ -54,7 +54,7 @@
* Default value: array containing 'email'
* Accepted values: array containing one or more of: email, username
*/
- 'auth_identity_fields' => array( 'email' , 'username'),
+ 'auth_identity_fields' => array( 'email'),
/**
* Login form timeout
@@ -84,7 +84,7 @@
*
* Accepted values: boolean true or false
*/
- 'login_after_registration' => false,
+ 'login_after_registration' => true,
/**
* Registration Form Captcha
@@ -0,0 +1,134 @@
+<?php
+$settings = array(
+ /**
+ * User Provider Entity Class
+ *
+ * Name of Entity class to use. Useful for using your own entity class
+ * instead of the default one provided. Default is ScnSocialAuth\Entity\UserProvider.
+ */
+ 'user_provider_entity_class' => 'ScnSocialAuth\Entity\UserProvider',
+
+ /**
+ * Facebook Enabled
+ *
+ * Please specify if Facebook is enabled
+ */
+ 'facebook_enabled' => false,
+
+ /**
+ * Facebook Scope
+ *
+ * Please specify a Facebook scope
+ *
+ * A comma-separated list of permissions you want to request from the user.
+ * See the Facebook docs for a full list of available permissions:
+ * http://developers.facebook.com/docs/reference/api/permissions.
+ */
+ //'facebook_scope' => '',
+
+ /**
+ * Facebook Display
+ *
+ * Please specify a Facebook display
+ *
+ * The display context to show the authentication page.
+ * Options are: page, popup, iframe, touch and wap.
+ * Read the Facebook docs for more details:
+ * http://developers.facebook.com/docs/reference/dialogs#display. Default: page
+ */
+ //'facebook_display' => '',
+
+ /**
+ * Foursquare Enabled
+ *
+ * Please specify if Foursquare is enabled
+ */
+ 'foursquare_enabled' => false,
+
+ /**
+ * Github Enabled
+ *
+ * Please specify if Github is enabled
+ *
+ * You can register a new application at:
+ * https://github.com/settings/applications/new
+ */
+ 'github_enabled' => true,
+
+ /**
+ * Github Scope
+ *
+ * Please specify a Github scope
+ *
+ * A comma-separated list of permissions you want to request from the user.
+ * See he Github docs for a full list of the available permissions:
+ * http://developer.github.com/v3/oauth/#scopes
+ */
+ 'github_scope' => '',
+
+ /**
+ * Google Enabled
+ *
+ * Please specify if Google is enabled
+ */
+ 'google_enabled' => true,
+
+ /**
+ * Google Scope
+ *
+ * Please specify a Google scope
+ *
+ * A space-separated list of permissions you want to request from the user.
+ * See the Google docs for a full list of available permissions:
+ * https://developers.google.com/accounts/docs/OAuth2Login#scopeparameter.
+ */
+ 'google_scope' => 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email',
+
+ /**
+ * LinkedIn Enabled
+ *
+ * Please specify if LinkedIn is enabled
+ */
+ 'linkedIn_enabled' => false,
+
+ /**
+ * Twitter Enabled
+ *
+ * Please specify if Twitter is enabled
+ */
+ 'twitter_enabled' => true,
+
+ /**
+ * Yahoo! Enabled
+ *
+ * Please specify if Yahoo! is enabled
+ */
+ 'yahoo_enabled' => false,
+
+ /**
+ * Set to true if you want to display only the social login buttons without
+ * the username/password etc. from ZfcUser.
+ */
+ 'social_login_only' => true,
+
+ /**
+ * The home route key as used in your application
+ */
+ 'home_route' => 'home',
+
+ /**
+ * End of ScnSocialAuth configuration
+ */
+);
+
+/**
+ * You do not need to edit below this line
+ */
+return array(
+ 'scn-social-auth' => $settings,
+ 'service_manager' => array(
+ 'aliases' => array(
+ 'ScnSocialAuth_ZendDbAdapter' => (isset($settings['zend_db_adapter'])) ? $settings['zend_db_adapter']: 'Zend\Db\Adapter\Adapter',
+ ),
+ ),
+);
@@ -22,7 +22,16 @@ public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
- __DIR__ . '/autoload_classmap.php'
+ __DIR__ . '/autoload_classmap.php',
+ array(
+ 'Hybrid_Storage' => getcwd() . '/vendor/hybridauth/hybridauth/hybridauth/Hybrid/Storage.php',
+ 'Hybrid_Error' => getcwd() . '/vendor/hybridauth/hybridauth/hybridauth/Hybrid/Error.php',
+ 'Hybrid_Logger' => getcwd() . '/vendor/hybridauth/hybridauth/hybridauth/Hybrid/Logger.php',
+ 'Hybrid_Auth' => getcwd() . '/vendor/hybridauth/hybridauth/hybridauth/Hybrid/Auth.php',
+ 'Hybrid_Provider_Model' => getcwd() . '/vendor/hybridauth/hybridauth/hybridauth/Hybrid/Provider_Model.php',
+ 'Hybrid_Provider_Model_OAuth2' => getcwd() . '/vendor/hybridauth/hybridauth/hybridauth/Hybrid/Provider_Model_OAuth2.php',
+ 'Hybrid_Providers_GitHub' => getcwd() . '/vendor/hybridauth/hybridauth/additional-providers/hybridauth-github/Providers/GitHub.php',
+ ),
),
);
}

0 comments on commit 7d6b984

Please sign in to comment.