• No results found

CASifier une application

N/A
N/A
Protected

Academic year: 2021

Share "CASifier une application"

Copied!
20
0
0

Loading.... (view fulltext now)

Full text

(1)

JOSY « Authentification Centralisée »

Paris, 6 mai 2010

CASifier une application

(2)

CASifier une application

Introduction

Moyens

– Module Apache CAS (mod_auth_cas)

– Librairie PHP (phpCAS)

– Filtre Java

– Module PAM (Pam_cas)

(3)

Introduction

Quelques principes

– Le serveur CAS doit être accessible

– Le serveur CAS doit être accessible

– Les applications doivent maintenir des sessions

– Les applications doivent pouvoir gérer les

(4)

Module Apache CAS (mod_auth_cas)

Module Apache 2.x

L’identifiant utilisateur se retrouve dans

L’identifiant utilisateur se retrouve dans

REMOTE_USER

(5)

Module Apache CAS (mod_auth_cas)

LoadModule auth_cas_module modulesN2/mod_auth_cas.so

<IfModule mod_auth_cas.c> CASVersion 2 CASDebug Off CASDebug Off CASValidateServer Off CASLoginURL https://auth.univ.fr CASValidateURL https://auth.univ.fr/serviceValidate CASCookiePath /var/cas/ CASTimeout 7200 CASIdleTimeout 3600 CASCacheCleanInterval 1800 </IfModule>

(6)

Module Apache CAS (mod_auth_cas)

<IfModule mod_auth_cas.c>

AuthName "Authentification centrale" AuthName "Authentification centrale" AuthType CAS

</IfModule>

(7)

Librairie PHP (phpCAS)

Module PHP > 4.2

– Extension curl

– Extension openssl

– Extension DOM (xml pour PHP4)

– Extension Zlib (PHP4)

– Extension Zlib (PHP4)

Gère le logout

(8)

Librairie PHP (phpCAS)

<? include_once('CAS.php'); phpCAS::client(CAS_VERSION_2_0, 'auth.univ.fr',443,''); phpCAS::handleLogoutRequests(true, array("auth.univ.fr")); phpCAS::handleLogoutRequests(true, array("auth.univ.fr")); phpCAS::setNoCasServerValidation(); phpCAS::forceAuthentication(); echo phpCAS::getUser(); ?>

(9)

Filtre Java

5 Filtres :

– Authentication Filter

– Validation Filter

– HttpServletRequest Wrapper Filter

– Assertion Thread Local Filter

– Single Sign Out Filter

1 Session Listener :

(10)

Filtre Java

Authentication Filter

– Va intercepter les clients et les renvoyer au serveur CAS si il ne sont pas

déjà authentifiés

<filter>

<filter-name>CAS Authentication Filter</filter-name>

<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class> <init-param> <param-name>casServerLoginUrl</param-name> <param-value>https://auth.univ.fr/login</param-value> </init-param> </filter>

(11)

Filtre Java

Validation Filter

– Va intercepter les tickets et les valider auprès du CAS

<filter>

<filter-name>CAS Validation Filter</filter-name> <filter-class> org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter </filter-class> </filter-class> <init-param> <param-name>casServerUrlPrefix</param-name> <param-value>https://auth.univ.fr</param-value> </init-param> <init-param> <param-name>serverName</param-name> <param-value>http://application.univ.fr</param-value> </init-param>

(12)

Filtre Java

HttpServletRequest Wrapper Filter

– Va mettre à disposition l’identifiant utilisateur dans

HttpServletRequest.getRemoteUser ()

<filter>

<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name> <filter-class>

org.jasig.cas.client.util.HttpServletRequestWrapperFilter </filter-class>

(13)

Filtre Java

Assertion Thread Local Filter

– Va mettre à disposition l’identifiant utilisateur dans un Thread local pour

les classes ne pouvant pas accéder à HttpServletRequest

<filter>

<filter-name>CAS Assertion Thread Local Filter</filter-name> <filter-class>

org.jasig.cas.client.util.AssertionThreadLocalFilter </filter-class>

(14)

Filtre Java

Single Sign Out Filter

– Va intercepter les demandes de logout

<filter>

<filter-name>CAS Single Sign Out Filter</filter-name>

<filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class> </filter>

SingleSignOutHttpSessionListener

– Va surveiller les sessions utilisateurs afin de délogguer lors de

l’expiration

<listener>

<listener-class>

org.jasig.cas.client.session.SingleSignOutHttpSessionListener </listener-class>

(15)

Module PAM (Pam_cas)

Pluggable Authentication Modules

Est utilisé dans les mecanismes n-tiers (imap,

Est utilisé dans les mecanismes n-tiers (imap,

ftp, …)

(16)

Module PAM (Pam_cas)

application cliente login/password application cliente application serveur login/ticket pam_cas pam_pwdb pam_ldap Annuaire LDAP login/password /etc/passwd login/password serveur CAS ticket

(17)

Module PAM (Pam_cas)

Pour un serveur imap par exemple :

/etc/pam.d/imap

auth sufficient /lib/security/pam_cas.so -simap://imap.univ.fr -f/etc/pam_cas.conf auth sufficient /lib/security/pam_ldap.so

auth required /lib/security/pam_pwdb.so shadow nullok account required /lib/security/pam_pwdb.so shadow nullok

(18)

Module PAM (Pam_cas)

Pour un serveur imap par exemple :

/etc/pam.d/imap

auth sufficient /lib/security/pam_cas.so -simap://imap.univ.fr -f/etc/pam_cas.conf auth sufficient /lib/security/pam_ldap.so

auth required /lib/security/pam_pwdb.so shadow nullok account required /lib/security/pam_pwdb.so shadow nullok

(19)

Module PAM (Pam_cas)

/etc/pam_cas.conf

host auth.univ.fr

uriValidate /proxyValidate

ssl off

debug off

trusted_ca /Cert/mycert.pem

(20)

Des questions ?

http://www.ja-sig.org/wiki/display/CASC/Home

http://www.ja-sig.org/wiki/display/CASC/mod_auth_cas

http://www.ja-sig.org/wiki/display/CASC/phpCAS

http://www.ja-sig.org/wiki/display/CASC/phpCAS

http://www.esup-portail.org/consortium/espace/SSO_1B/tech/cas/cas_pam.

html

References

Related documents

As a large proportion of the costs of telecom can be attributed to long term investments in the access-network, careful forecasting of network requirements is essential for

To provide business advice for Chilean pre-service and in- service English teachers who are aspiring to become a private English tutor, this study seeks to

Nevertheless, dosage and intervals of subcutaneous TCZ administration could be adjusted during the course of treatment since 80% of non-Japanese RA patients with usually higher

Second, substrate surface temperature and flux rates (arrival rate of beam atoms or molecules onto the substrate surface) are critical and should be controlled precisely

However, business cycles in the model have three components: a TFP shock z , an aggregate labor supply shifter (LSS) z , and counter-cyclical earnings variance (CEV) of the

This course is designed to prepare credit union employees to cross sell additional products and services to members. Employees will learn that cross selling is a basic skill that

The goals of the study indicated in Democracy related unit in Social Studies Curriculum in Turkey is examined comparatively with North Rhine-Westphalia State of