Apple OS X manual Authenticating a User to a Node

Page 29

C H A P T E R 2

Working with Nodes

if ( dirStatus == eDSNoErr )

{

dirStatus = MyOpenDirNode( &nodeRef ); if ( dirStatus == eDSNoErr )

{

dsCloseDirNode( nodeRef );

}

}

if ( gDirRef != NULL )

{

dirStatus = dsCloseDirService( gDirRef );

}

}

long MyOpenDirNode ( tDirNodeReference *outNodeRef )

{

long dirStatus = eDSNoErr; char nodeName[ 256 ] = "\0"; tDataListPtr nodePath = NULL; printf( "Open Node : " ); fflush( stdout );

scanf( "%s", nodeName );

printf( "Opening: %s.\n", nodeName );

nodePath = dsBuildFromPath( gDirRef, nodeName, "/" ); if ( nodePath != NULL )

{

dirStatus = dsOpenDirNode( gDirRef, nodePath, outNodeRef ); if ( dirStatus == eDSNoErr )

{

printf( "Open succeeded. Node Reference = %lu\n", (unsigned long)outNodeRef );

}

else

{

printf( "Open node failed. Err = %ld\n", dirStatus );

}

}

dsDataListDeallocate( gDirRef, nodePath ); free( nodePath );

return( dirStatus ); } // MyOpenDirNode

Authenticating a User to a Node

To authenticate itself to the Open Directory for the purposes of reading, writing, or making changes to a node, an Open Directory client application calls dsDoDirNodeAuth. The dsDoDirNodeAuth function handles authentication methods that use one or more steps to complete the authentication process.

To determine the authentication methods that a node supports, call dsGetDirNodeInfo for the node and request the kDSNAttrAuthMethod attribute. For any particular user, some methods may not be supported. The available authentication methods depend on the authentication authority of the user that is being authenticated.

Authenticating a User to a Node

29

2007-01-08 © 2007 Apple Inc. All Rights Reserved.

Image 29
Contents Open Directory Programming Guide Apple Inc Contents N T E N T S Figures, Tables, and Listings G U R E S , T a B L E S , a N D L I S T I N G S See Also Organization of This DocumentIntroduction See Also Open Directory Overview Concepts1Flow of an Open Directory request Nodes2An Open Directory request over a network Record Types Search Policies and Search NodesConstant Description Standard attribute for storing a unique ID commonly found Standard Attribute TypesNative Attribute Types AuthenticationBasic Authentication Open Directory Overview Local Windows Hash Authentication Local Cached User Authentication Disabled User Authentication Directory Proxy Directory Native AuthenticationOpen Directory, lookupd, and NetInfo 3lookupd and NetInfo interaction when using SSH Debugging Directory Service Command Line UtilityListing Registered Nodes Working with Nodes Working with Nodes Finding a Node Opening and Closing a Node Authenticating a User to a Node Authenticating using directory native authentication Directory Native AuthenticationWorking with Nodes Working with Nodes Authenticating a User to a Node Listing Records Working with RecordsListing Records Working with Records Getting Information About a Record’s AttributeGetting Information About a Record’s Attribute Setting the Name of a Record Working with Records Listing 3-3Setting the name of a record Creating a Record and Adding an Attribute Void CreateRecord const tDirNodeReference inDirNodeRef Deleting a Record Working with Records Document Revision History Document Revision History
Related manuals
Manual 32 pages 7.58 Kb