GSSAPIContext
PHP Manual

GSSAPIContext::initSecContext

(No version information available, might be only in CVS)

GSSAPIContext::initSecContextInitiates a GSSAPI security context

Description

public bool GSSAPIContext::initSecContext ( string $target [, string $input_token [, int $reqflags [, int $timereq [, string &$output_token [, string &$ret_flags [, string &$time_rec ]]]]]] )

This method initiates a GSSAPI context. GSSAPIContext::acquireCredentials should first be used to select the correct credentials, otherwise the default credential cache will be used.

Parameters

target

SPN of principal to establish security context with.

input_token

GSSAPI Token passed by the context acceptor (for the kerberos mechanism only required if mutual authentication is performed).

reqflags

GSSAPI Context flags (see the Constants section, defaults to no flags)

timereq

Time in seconds which the context should stay valid (defaults to 0, which means the context will stay valid as long as possible)

output_token

Token to pass to the context acceptor for authentication

ret_flags

Flags of the (possibly not yet established) security context

time_rec

Time in seconds which the context will stay valid

Return Values

Returns true if the context is fully established and false otherwise.

Examples

Example #1 GSSAPIContext::initSecContext() example

<?php
// assume $client is a KRB5CCache containing credentials for client@MYREALM
// assume $server is a KRB5CCache containing credentials for server@MYREALM (initialized using keytab)

$cgssapi = new GSSAPIContext();
$cgssapi->acquireCredentials($client);

$sgssapi = new GSSAPIContext();
$sgssapi->acquireCredentials($server);

$token '';
$cgssapi->initSecContext("server@MYREALM"nullnullnull$token);

$token2 '';
$remote '';
$sgssapi->acceptSecContext($token$token2$remote);

echo 
$remote;
?>

The above example will output something similar to:

client@MYREALM

See Also


GSSAPIContext
PHP Manual