SSO With eZ publish

Author Message

Brijesh Tekrawala

Thursday 10 February 2011 3:14:44 am

Hi All,

I am creating SSO handler for my applicaiton, is there any sample code available for below

to create user

authenticate user

redirect to home page of ez publish

Matthieu Sévère

Thursday 10 February 2011 3:27:39 am

Hi,

You should have a look at this project : http://projects.ez.no/janrainauth

It doesn't use a SSO handler but you have example code to login and create users.

Cheers

--
eZ certified developer: http://ez.no/certification/verify/346216

Brijesh Tekrawala

Thursday 10 February 2011 4:35:40 am

I have another site available and need to setup SSO from there. can someone please send sample code for SSOHandler ?

B Pierre

Friday 11 February 2011 7:26:31 am

In french : http://www.lolart.net/blog/ez-publish/utilisation-d-un-sso-dans-ez-publish

In english : http://share.ez.no/learn/ez-publish/using-a-sso-in-ez-publish

A simple sample :

"

public function handleSSOLogin()
{
$currentUser = false; // Valeur par defaut que l'on retourne si l'authentification échoue

//Si un utilisateur est authentifié on le récupère.
if (phpCAS::checkAuthentication())
{
$currentUser = eZUser::fetchByName(phpCAS::getUser());

//Si l'utilisateur n'est pas connu dans eZPublish
if(!is_object( $currentUser ))
{
$currentUser=false;
}
}

return ($currentUser);
}

"

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:44:47
Script start
Timing: Jan 18 2025 02:44:47
Module start 'layout'
Timing: Jan 18 2025 02:44:47
Module start 'content'
Timing: Jan 18 2025 02:44:48
Module end 'content'
Timing: Jan 18 2025 02:44:48
Script end

Main resources:

Total runtime0.9472 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0148 593.5547153.4375
Module start 'layout' 0.01480.0039 746.992239.3672
Module start 'content' 0.01870.9270 786.3594583.8516
Module end 'content' 0.94570.0015 1,370.210912.1875
Script end 0.9472  1,382.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3721160.0002
Check MTime0.00140.1465160.0001
Mysql Total
Database connection0.00140.146310.0014
Mysqli_queries0.870391.8808640.0136
Looping result0.00080.0820620.0000
Template Total0.898594.920.4493
Template load0.00230.239520.0011
Template processing0.896394.622520.4481
Template load and register function0.00040.038910.0004
states
state_id_array0.00450.479310.0045
state_identifier_array0.00160.166120.0008
Override
Cache load0.00200.2145420.0000
Sytem overhead
Fetch class attribute can translate value0.00080.083230.0003
Fetch class attribute name0.00240.249450.0005
XML
Image XML parsing0.00080.083830.0003
class_abstraction
Instantiating content class attribute0.00000.002150.0000
General
dbfile0.00090.0908160.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs