SSO and certificate?

Author Message

Siniša Šehović

Thursday 08 June 2006 2:29:55 am

Hi

I need to implement logging in with SSO and certificate from smartcard.
Certificate is handled by tomcat and servlet.

Does anyone here have any experience or some kind of guidance how to do that?

Basically servlet verifies certificate from smartcard and send true or false and redirect to url.

Best regards,
Sinisa

---
If at first you don't succeed, look in the trash for the instructions.

Siniša Šehović

Monday 12 June 2006 12:26:53 am

Hi all

To be more understandable here is a short description how this servlet works.

I have to send two parameters sessionID and redirectURI.

Servlet then read user certificate from smart card, verify it and return sessionID and username from smartcard with GET method.
Then redirect to redirectURI.

After that I must verify if sessionIDs mach and with sso handler do loggin.

How can I accomplish that inside custom extension?

My code example works.

<b>login.php</b>

<?php

session_start();


$sessionID = $_SESSION['sessionId'];
$username = $_SESSION['username'];

if ($sessionID == null)
{
	$sessionID = session_id();
	$_SESSION['sessionId'] = $sessionID;
}

if ($username !=null)
{
	echo "User ".$username." autenticated";
} else {
	$hostname = 'tomcat';
	$returnHostname = 'test';
	$webAuthUrl = 'https://'.$hostname.':443/Auth/Auth';
	$appId = 'INTRANET';
	$tokenId = $sessionID;
	$returnParams = 'yes';
	$returnUrl = 'http://'.$returnHostname.'/kart/auth.php';
	$authUrl = $webAuthUrl.'?appid='.$appId.'&tokenid='.$tokenId.'&return_params='.$returnParams.'&return_url='.$returnUrl;
	echo "<a href=".$authUrl.">Loggin</a>";
}

?>

and <b>auth.php</b>

<?php
session_start();
$sessionID = $_SESSION['sessionId'];
$tokenId = $_GET['tokenid'];
$username = $_GET['username'];

if ($tokenId == $sessionID) {
	$_SESSION['username'] = $username;
	
	header("Cache-Control: no-cache, must-revalidate");
	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
	header("Location: http://test/kart/login.php"); 

exit;

} else {
	echo "Can't let you in :-)";
}

?>

Best regards,
Sinisa

---
If at first you don't succeed, look in the trash for the instructions.

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 21 2025 02:54:35
Script start
Timing: Jan 21 2025 02:54:35
Module start 'layout'
Timing: Jan 21 2025 02:54:35
Module start 'content'
Timing: Jan 21 2025 02:54:35
Module end 'content'
Timing: Jan 21 2025 02:54:35
Script end

Main resources:

Total runtime0.0192 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.8125151.1953
Module start 'layout' 0.00610.0033 739.007836.6172
Module start 'content' 0.00940.0081 775.625090.2500
Module end 'content' 0.01750.0016 865.875033.9922
Script end 0.0191  899.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002814.5549140.0002
Check MTime0.00126.1694140.0001
Mysql Total
Database connection0.00126.077410.0012
Mysqli_queries0.003116.149130.0010
Looping result0.00000.094510.0000
Template Total0.00115.610.0011
Template load0.00094.658510.0009
Template processing0.00020.912810.0002
Override
Cache load0.00073.499410.0007
General
dbfile0.003015.738780.0004
String conversion0.00000.047340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs