class-phpCAS

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.
Overview

Classes

Interfaces

Exceptions

Functions

Class phpCAS

The phpCAS class is a simple container for the phpCAS library. It provides CAS authentication for web applications written in PHP.

Package: PhpCAS
Category: Authentication
License: Apache License 2.0
Author: Pascal Aubry pascal.aubry@univ-rennes1.fr
Author: Olivier Berger olivier.berger@it-sudparis.eu
Author: Brett Bieber brett.bieber@gmail.com
Author: Joachim Fritschi jfritschi@freenet.de
Author: Adam Franco afranco@middlebury.edu
Link: https://wiki.jasig.org/display/CASC/phpCAS
Class: phpCAS
Ingroup: public
Located at shared/cas/source/CAS.php
Methods summary
public static a
# client( string $server_version, string $server_hostname, string $server_port, string $server_uri, boolean $changeSessionID = true )

phpCAS client initializer.

public static a
# proxy( string $server_version, string $server_hostname, string $server_port, string $server_uri, boolean $changeSessionID = true )

phpCAS proxy initializer.

public static boolean
# isInitialized( )

Answer whether or not the client or proxy has been initialized

public static
# setDebug( string $filename = '' )

Set/unset debug mode

public static
# setVerbose( boolean $verbose )

Enable verbose errors messages in the website output This is a security relevant since internal status info may leak an may help an attacker. Default is therefore false

public static boot
# getVerbose( )

Show is verbose mode is on

public static
# log( string $str )

Logs a string in debug mode.

public static
# error( string $msg )

This method is used by interface methods to print an error and where the function was originally called from.

public static
# trace( string $str )

This method is used to log something in debug mode.

public static
# traceBegin( )

This method is used to indicate the start of the execution of a function in debug mode.

public static
# traceEnd( string $res = '' )

This method is used to indicate the end of the execution of a function in debug mode.

public static
# traceExit( )

This method is used to indicate the end of the execution of the program

public static
# setLang( string $lang )

This method is used to set the language used by phpCAS.

public static the
# getVersion( )

This method returns the phpCAS version.

public static
# setHTMLHeader( string $header )

This method sets the HTML header used for all outputs.

public static
# setHTMLFooter( string $footer )

This method sets the HTML footer used for all outputs.

public static
# setPGTStorage( CAS_PGTStorage $storage )

This method can be used to set a custom PGT storage object.

public static
# setPGTStorageDb( string $dsn_or_pdo, string $username = '', string $password = '', string $table = '', string $driver_options = null )

This method is used to tell phpCAS to store the response of the CAS server to PGT requests in a database.

public static
# setPGTStorageFile( string $path = '' )

This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem.

public static CAS_ProxiedService
# getProxiedService( string $type )

Answer a proxy-authenticated service handler.

public static
# initializeProxiedService( CAS_ProxiedService $proxiedService )

Initialize a proxied-service handler with the proxy-ticket it should use.

public static boolean
# serviceWeb( string $url, string & $err_code, string & $output )

This method is used to access an HTTP[S] service.

public static object
# serviceMail( string $url, string $service, string $flags, string & $err_code, string & $err_msg, string & $pt )

This method is used to access an IMAP/POP3/NNTP service.

public static
# setCacheTimesForAuthRecheck( integer $n )

Set the times authentication will be cached before really accessing the CAS server in gateway mode: - -1: check only once, and then never again (until you pree login) - 0: always check - n: check every "n" time

public static
# setCasAttributeParserCallback( string $function, array $additionalArgs = array() )

Set a callback function to be run when receiving CAS attributes

public static
# setPostAuthenticateCallback( string $function, array $additionalArgs = array() )

Set a callback function to be run when a user authenticates.

public static
# setSingleSignoutCallback( string $function, array $additionalArgs = array() )

Set a callback function to be run when a single-signout request is received. The callback function will be passed a $logoutTicket as its first parameter, followed by any $additionalArgs you pass. The $logoutTicket parameter is an opaque string that can be used to map a session-id to the logout request in order to support single-signout in applications that manage their own sessions (rather than letting phpCAS start and destroy the session).

public static true
# checkAuthentication( )

This method is called to check if the user is already authenticated locally or has a global cas session. A already existing cas session is determined by a cas gateway call.(cas login call without any interactive prompt)

public static boolean
# forceAuthentication( )

This method is called to force authentication if the user was not already authenticated. If the user is not authenticated, halt by redirecting to the CAS server.

public static
# renewAuthentication( )

This method is called to renew the authentication.

public static true
# isAuthenticated( )

This method is called to check if the user is authenticated (previously or by tickets given in the URL).

public static boolean
# isSessionAuthenticated( )

Checks whether authenticated based on $_SESSION. Useful to avoid server calls.

public static string
# getUser( )

This method returns the CAS user's login name.

public static array
# getAttributes( )

Answer attributes about the authenticated user.

public static boolean
# hasAttributes( )

Answer true if there are attributes for the authenticated user.

public static boolean
# hasAttribute( string $key )

Answer true if an attribute exists for the authenticated user.

public static mixed
# getAttribute( string $key )

Answer an attribute for the authenticated user.

public static
# handleLogoutRequests( boolean $check_client = true, array $allowed_clients = false )

Handle logout requests.

public static the
# getServerLoginURL( )

This method returns the URL to be used to login. or phpCAS::isAuthenticated().

public static
# setServerLoginURL( string $url = '' )

Set the login URL of the CAS server.

public static
# setServerServiceValidateURL( string $url = '' )

Set the serviceValidate URL of the CAS server. Used for all CAS versions of URL validations. Examples: CAS 1.0 http://www.exemple.com/validate CAS 2.0 http://www.exemple.com/validateURL CAS 3.0 http://www.exemple.com/p3/serviceValidate

public static
# setServerProxyValidateURL( string $url = '' )

Set the proxyValidate URL of the CAS server. Used for all CAS versions of proxy URL validations Examples: CAS 1.0 http://www.exemple.com/ CAS 2.0 http://www.exemple.com/proxyValidate CAS 3.0 http://www.exemple.com/p3/proxyValidate

public static
# setServerSamlValidateURL( string $url = '' )

Set the samlValidate URL of the CAS server.

public static the
# getServerLogoutURL( )

This method returns the URL to be used to login. or phpCAS::isAuthenticated().

public static
# setServerLogoutURL( string $url = '' )

Set the logout URL of the CAS server.

public static
# logout( string $params = "" )

This method is used to logout from CAS.

public static
# logoutWithRedirectService( string $service )

This method is used to logout from CAS. Halts by redirecting to the CAS server.

public static
# logoutWithUrl( string $url )

This method is used to logout from CAS. Halts by redirecting to the CAS server.

public static
# logoutWithRedirectServiceAndUrl( string $service, string $url )

This method is used to logout from CAS. Halts by redirecting to the CAS server.

public static
# setFixedCallbackURL( string $url = '' )

Set the fixed URL that will be used by the CAS server to transmit the PGT. When this method is not called, a phpCAS script uses its own URL for the callback.

public static
# setFixedServiceURL( string $url )

Set the fixed URL that will be set as the CAS service parameter. When this method is not called, a phpCAS script uses its own URL.

public static string
# getServiceURL( )

Get the URL that is set as the CAS service parameter.

public static string
# retrievePT( string $target_service, string & $err_code, string & $err_msg )

Retrieve a Proxy Ticket from the CAS server.

public static
# setCasServerCACert( string $cert, boolean $validate_cn = true )

Set the certificate of the CAS server CA and if the CN should be properly verified.

public static
# setNoCasServerValidation( )

Set no SSL validation for the CAS server.

public static
# setNoClearTicketsFromUrl( )

Disable the removal of a CAS-Ticket from the URL when authenticating DISABLING POSES A SECURITY RISK: We normally remove the ticket by an additional redirect as a security precaution to prevent a ticket in the HTTP_REFERRER or be carried over in the URL parameter

public static
# setExtraCurlOption( string $key, string $value )

Change CURL options. CURL is used to connect through HTTPS to CAS server

public static
# allowProxyChain( CAS_ProxyChain_Interface $proxy_chain )

If you want your service to be proxied you have to enable it (default disabled) and define an accepable list of proxies that are allowed to proxy your service.

public static array
# getProxies( )

Answer an array of proxies that are sitting in front of this application. This method will only return a non-empty array if we have received and validated a Proxy Ticket.

public static
# addRebroadcastNode( string $rebroadcastNodeUrl )

Add a pgtIou/pgtId and logoutRequest rebroadcast node.

public static
# addRebroadcastHeader( String $header )

This method is used to add header parameters when rebroadcasting pgtIou/pgtId or logoutRequest.

private static
# _validateClientExists( )

Checks if a client already exists

private static
# _validateProxyExists( )

Checks of a proxy client aready exists

public static
# setCasClient( CAS_Client $client )

For testing purposes, use this method to set the client to a test double

Properties summary
private static CAS_Client $_PHPCAS_CLIENT

This variable is used by the interface class phpCAS.

private static $_PHPCAS_INIT_CALL

This variable is used to store where the initializer is called from (to print a comprehensive error in case of multiple calls).

private static $_PHPCAS_DEBUG

This variable is used to store phpCAS debug mode.

private static boolean $_PHPCAS_VERBOSE

This variable is used to enable verbose mode This pevents debug info to be show to the user. Since it's a security feature the default is false

# false
 

© 2004-2018 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy