(No version information available, might be only in CVS)
GSSAPIContext::initSecContext — Initiates a GSSAPI security context
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.
SPN of principal to establish security context with.
GSSAPI Token passed by the context acceptor (for the kerberos mechanism only required if mutual authentication is performed).
GSSAPI Context flags (see the Constants section, defaults to no flags)
Time in seconds which the context should stay valid (defaults to 0, which means the context will stay valid as long as possible)
Token to pass to the context acceptor for authentication
Flags of the (possibly not yet established) security context
Time in seconds which the context will stay valid
Returns true if the context is fully established and false otherwise.
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", null, null, null, $token);
$token2 = '';
$remote = '';
$sgssapi->acceptSecContext($token, $token2, $remote);
echo $remote;
?>
The above example will output something similar to:
client@MYREALM