- OVERVIEW
- RELEASE FOR YII FEATURES
- HOMEPAGE
- DEMO
- USAGE
- OPTIONS
- INTERNATIONALIZATION
- TROUBLESHOOTING
- FOR LINUX
- GENERATING SPRITE BY HAND
- LICENSE
- Resources
OVERVIEW ¶
This is a simple Javascript OpenID selector. It has been designed so that users do not even need to know what OpenID is to use it, they simply select their account by a recognisable logo.
RELEASE FOR YII FEATURES ¶
What was done:
- Reviewed directory structure
- UK locale was renamed to UA
hint: like Ukrainian domain zone, not United Kingdom - Maked possible to edit config directly from widget
hint: it was only by hand in main js file - Found and added .sh script for generating sprites for Linux
- See more OPTIONS in extension page
HOMEPAGE ¶
http://code.google.com/p/openid-selector/
DEMO ¶
See http://openid-selector.googlecode.com/svn/trunk/demo.html
USAGE ¶
Paste next code in your view:
<?php $this->widget('application.widgets.openidProviders.openidProviders',array('options'=>array('lang'=>'ru','demo'=>'js:true'))); ?>
OPTIONS ¶
Its very simple to understand:
- List of providers and locale properties defiled in 'assets/js/assets-jquery-{locale}.js'
- CSS file is in 'assets/css/openid.css' directory
- Views are in 'views/main-{locale}.php'
- Native openid props can be changed from widget call adding 'options' array:
- version: '1.2', // version constant
- demo: false, //if false - there is only alert message not redirecting to provider
- demo_text: 'In client demo mode. Normally would have submitted OpenID:',
- cookie_expires: 6*30, // 6 months.
- cookie_name: 'openid_provider',
- cookie_path: '/',
- img_path: 'images/', //path to images dir by default is staged by widget in assets dir
- lang: null, // language, is set in openid-jquery-.js //staged by widget in 'en'
- signin_text: null, // text on submit button on the form
- input_id: null,
- provider_url: null,
- provider_id: null,
- all_small: false, // output large providers w/ small icons
- no_sprite: false, // don't use sprite image
- image_title: '{provider}', // for image title
INTERNATIONALIZATION ¶
Now there are English, Russian and Ukrainian languages available
- Create view in '/views' dir with your locale naming short-code
- Create providers list in '/assets/js' dir with your locale naming short-code
- If it`s differs from existing image sprites - generate sprites by instruments from '/tools' dir. See readme to get hints.
TROUBLESHOOTING ¶
Please remember after you change list of providers, you must run tools/generate-sprite.js to refresh sprite image
generate-sprite.js requires ImageMagick to be installed and works only in Windows (Linux and Apple users can run in VM)
Before running generate-sprite.js for the first time, check its source code and correct line 16 (var imagemagick = '<...>';) to point to ImageMagick install dir.
FOR LINUX ¶
There is sh script for generating sprites
http://code.google.com/p/openid-selector/source/browse/trunk/generate-sprite.sh?r=115
USAGE:
- Go to tools dir: [user@localhost home] cd /path/to/tools/directory
- Run generating script: [user@localhost tools] sh generate-sprite.sh en
- After generating, please remove sprite-generators dir from project
GENERATING SPRITE BY HAND ¶
First row - big images one by one 60x100px
Second row - as I knew one by one 24x24px
Glue images like in examples
LICENSE ¶
openid-selector code is licenced under the New BSD License.
Resources ¶
- [OpenID selector Project page](http://code.google.com/p/openid-selector/ )
- OpenID selector online demo
can not unzip files
unzip file error. Only the folds was unzipped.
@bitshine
Hmm... Downloaded and unzipped successfully.
Do not know how to use
can I use lightOpenId?
Do I need to modify user module? (I use this module for login and register)
@bitshine
This extension merely allows the user to pick (graphically) which OpenID provider they would like to use, and then passes that as a parameter to your lightopenid wrapper (yii extension LOID and COpenId are used for lightopenid) however you're logging in.
In my case, I extended the UserIdentity class, and created a new method called loginOpenId, which gets passed the authenticated user id from COpenId.
Flow:
simpleopenidselector passes selected provider -> COpenId or LOID authenticates user and passes authenticated identity -> UserIdentity logs user in and authorizes access
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.