369 lines
12 KiB
HTML
369 lines
12 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
|
<HTML>
|
||
|
<HEAD>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
|
||
|
<TITLE>ictxRetrieveIdContext()--Retrieve Identity Context</TITLE>
|
||
|
<!-- Begin Header Records ========================================= -->
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<!-- Change History: -->
|
||
|
<!-- YYMMDD USERID Change description -->
|
||
|
<!-- End Header Records -->
|
||
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
</HEAD>
|
||
|
<BODY>
|
||
|
<!--Java sync-link-->
|
||
|
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
|
||
|
</script>
|
||
|
|
||
|
<A name=Top_Of_Page>
|
||
|
</A>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<H2>
|
||
|
ictxRetrieveIdContext()--Retrieve Identity Context
|
||
|
</H2>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- S Y N T A X / P A R M T A B L E -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<div class="box" style="width: 90%;">
|
||
|
<BR> Syntax
|
||
|
<PRE>
|
||
|
#include <ictx.h>;
|
||
|
|
||
|
int ictxRetrieveIdContext
|
||
|
(
|
||
|
ictxStorageMech_t * <EM>storageMechanism</EM>,
|
||
|
ictxIdContextCredential_t * <EM>credential</EM>,
|
||
|
ictxIdContext_t ** <EM>identityContext</EM>,
|
||
|
ictxError_t * <EM>errorInfo</EM>
|
||
|
)
|
||
|
</PRE>
|
||
|
<BR>
|
||
|
Threadsafe: Yes
|
||
|
<BR>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
See <a href="#eserver_notes">eServer Implementation Notes</a>
|
||
|
for details on platform-specific details for this API.<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
|
||
|
</div>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- D E S C R I P T I O N -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<BR>
|
||
|
<P>The <STRONG>ictxRetrieveIdContext()</STRONG> function
|
||
|
retrieves an identity context using the designated storage mechanism
|
||
|
and reference to that context.
|
||
|
</P>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- A U T H O R I T I E S A N D L O C K S -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<BR>
|
||
|
<h3>
|
||
|
Authorities and Locks
|
||
|
</h3>
|
||
|
<P>
|
||
|
Refer to storage mechanism for authority information.
|
||
|
See <A
|
||
|
href="ictxstoragemech.htm">
|
||
|
ictxStorageMech--Identity Context Storage Mechanism Parameter</A>.
|
||
|
</P>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- P A R A M E T E R S -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<BR>
|
||
|
<H3>Parameters</H3>
|
||
|
<DL>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- storageMechanism -->
|
||
|
<!-- ============================================================== -->
|
||
|
<DT>
|
||
|
<STRONG>storageMechanism</STRONG> (Input)
|
||
|
<DD>The storage mechanism to use when retrieving the identity
|
||
|
context information.
|
||
|
For the format of the structure, see <A
|
||
|
href="ictxstoragemech.htm">
|
||
|
ictxStorageMech--Identity Context Storage Mechanism Parameter</A>.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- credential -->
|
||
|
<!-- ============================================================== -->
|
||
|
<DT>
|
||
|
<STRONG>credential</STRONG> (Input)
|
||
|
<DD>The credential information that is a reference to an identity context.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- identityContext -->
|
||
|
<!-- ============================================================== -->
|
||
|
<DT>
|
||
|
<STRONG>identityContext</STRONG> (Output)
|
||
|
<DD>Return pointer to the identity context that was retrieved.
|
||
|
For the format of the structure, see <A
|
||
|
href="ictxidcontext.htm">
|
||
|
ictxIdContext--Identity Context Info Parameter</A>.
|
||
|
When this identity context is no longer needed,
|
||
|
it must be freed using the Free Identity Context (ictxFreeIdContext) API.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- errorInfo -->
|
||
|
<!-- ============================================================== -->
|
||
|
<DT>
|
||
|
<STRONG>errorInfo</STRONG> (Output)
|
||
|
<DD>The structure in which to return error code information. If the return
|
||
|
value is not 0, <EM>errorInfo</EM> is set with additional information. This
|
||
|
parameter may be NULL. For the format of the structure, see <A
|
||
|
href="ictxerror.htm">ictxError--Identity
|
||
|
Context Return Code Parameter</A>.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- R E T U R N V A L U E -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<BR>
|
||
|
<H3>Return Value</H3>
|
||
|
<P>The return value from the API.</P>
|
||
|
<DL>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- 0 -->
|
||
|
<!-- ============================================================== -->
|
||
|
<DT>
|
||
|
<STRONG>0</STRONG>
|
||
|
<DD>Request was successful.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- Errors -->
|
||
|
<!-- ============================================================== -->
|
||
|
<DT>
|
||
|
<STRONG>ICTXERR_PARM_REQ (1)</STRONG>
|
||
|
<DD>Missing required parameter. Please check API documentation.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
<DT>
|
||
|
<STRONG>ICTXERR_NOMEM (2)</STRONG>
|
||
|
<DD>No memory available. Unable to allocate required space.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
<DT>
|
||
|
<STRONG>ICTXERR_EIM (3)</STRONG>
|
||
|
<DD>Error occurred using EIM interfaces.<BR>
|
||
|
<BR>
|
||
|
|
||
|
<DT>
|
||
|
<STRONG>ICTXERR_STORAGEMECH_NOT_SUPPORTED (5)</STRONG>
|
||
|
<DD>The storage mechanism is not a supported storage
|
||
|
mechanism.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
<DT>
|
||
|
<STRONG>ICTXERR_IDCONTEXT_NOT_FOUND (8)</STRONG>
|
||
|
<DD>Identity context was not found. The context reference may have expired
|
||
|
or the context reference may not be usable due to clock mismatch.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
<DT>
|
||
|
<STRONG>ICTXERR_AMBIGUOUS (9)</STRONG>
|
||
|
<DD>Amiguous information found when searching for identity context.
|
||
|
Unable to return identity context information.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
|
||
|
<DT>
|
||
|
<STRONG>ICTXERR_STORAGEMECH_INVALID (28)</STRONG>
|
||
|
<DD>Storage mechanism parameter is not valid.
|
||
|
A required parameter may be missing.
|
||
|
<BR>
|
||
|
<BR>
|
||
|
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- U S A G E N O T E S -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- E S E R V E R N O T E S -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<BR>
|
||
|
<h3>
|
||
|
<a name="eserver_notes">eServer Implementation Notes</a>
|
||
|
</h3>
|
||
|
<ol>
|
||
|
<li>
|
||
|
<strong>AIX implementation details:</strong>
|
||
|
<ul>
|
||
|
<li>
|
||
|
Authority: None
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<strong>Linux implementation details:</strong>
|
||
|
<ul>
|
||
|
<li>
|
||
|
Authority: None
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<strong>i5/OS implementation details:</strong><br>
|
||
|
|
||
|
<ul>
|
||
|
<li>
|
||
|
Service Program Name: QSYS/QSYICTX<br>
|
||
|
</li>
|
||
|
<li>
|
||
|
Authority: Default public authority *USE
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<strong>Windows implementation details:</strong>
|
||
|
<ul>
|
||
|
<li>
|
||
|
Authority: Users must have administrative privilege to
|
||
|
install and work with the APIs.
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<strong>z/OS implementation details:</strong><br>
|
||
|
|
||
|
<ul>
|
||
|
<li>
|
||
|
Authority: The caller of the API must be APF-authorized.
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ol>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- R E L A T E D I N F O R M A T I O N -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<BR>
|
||
|
<H3>Related Information</H3>
|
||
|
<UL>
|
||
|
<LI>
|
||
|
<A
|
||
|
href="ictxstoreidcontext.htm">ictxStoreIdContext()</A>
|
||
|
--Store Identity Context<BR>
|
||
|
<BR>
|
||
|
</LI>
|
||
|
<LI>
|
||
|
<A
|
||
|
href="ictxremoveidcontext.htm">ictxRemoveIdContext()</A>
|
||
|
--Remove Identity Context<BR>
|
||
|
<BR>
|
||
|
</LI>
|
||
|
<LI>
|
||
|
<A
|
||
|
href="ictxremoveexpiredidcontexts.htm">ictxRemoveExpiredIdContexts()</A>
|
||
|
--Remove Expired Identity Context<BR>
|
||
|
<BR>
|
||
|
</LI>
|
||
|
<LI>
|
||
|
<A
|
||
|
href="ictxfreeidcontext.htm">ictxFreeIdContext()</A>
|
||
|
--Free Identity Context Storage<BR>
|
||
|
<BR>
|
||
|
</LI>
|
||
|
<LI>
|
||
|
<A
|
||
|
href="ictxfreeidcontextcredential.htm">ictxFreeIdContextCredential()</A>
|
||
|
--Free Identity Context Credential<BR>
|
||
|
<BR>
|
||
|
</LI>
|
||
|
</UL>
|
||
|
<BR>
|
||
|
<BR>
|
||
|
<!-- ============================================================== -->
|
||
|
<!-- -->
|
||
|
<!-- E X A M P L E -->
|
||
|
<!-- -->
|
||
|
<!-- ============================================================== -->
|
||
|
<BR>
|
||
|
<h3>
|
||
|
Example
|
||
|
</h3>
|
||
|
<p>
|
||
|
The following example retrieves an authentication context.
|
||
|
The caller supplies the correct storage mechanism information.
|
||
|
<b>Note:</b> Read the <a href="codedisclaimer.htm">Code example disclaimer</a>
|
||
|
for important legal information.
|
||
|
</p>
|
||
|
<pre>
|
||
|
#include <ictx.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
|
||
|
int retrieveIdContext( ictxStorageMech_t * storageMech,
|
||
|
ictxIdContextCredential_t * credential,
|
||
|
ictxIdContext_t ** authContext)
|
||
|
{
|
||
|
int rc;
|
||
|
|
||
|
ictxOptions_t options;
|
||
|
|
||
|
ictxError_t errorInfo;
|
||
|
|
||
|
/*----------------------------------------------------------------*/
|
||
|
/* Retrieve authentication context */
|
||
|
/*----------------------------------------------------------------*/
|
||
|
if (0 != (rc = ictxRetrieveIdContext(storageMech,
|
||
|
credential,
|
||
|
authContext,
|
||
|
&errorInfo)))
|
||
|
{
|
||
|
.
|
||
|
.
|
||
|
.
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
</pre>
|
||
|
|
||
|
<hr>
|
||
|
<center>
|
||
|
<table cellpadding="2" cellspacing="2">
|
||
|
<tr align="center">
|
||
|
<td valign="middle" align="center">
|
||
|
<a href="#Top_Of_Page">Top</a> |
|
||
|
<a href="sec.htm">Security APIs</a> |
|
||
|
<a href="aplist.htm">APIs by category</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</center>
|
||
|
</BODY>
|
||
|
</HTML>
|