Apple OS X manual Working with Nodes

Page 31

C H A P T E R 2

Working with Nodes

::memcpy(&(anAuthDataBuf->fBufferData[aCurLength]), &aTempLength, sizeof(long));

aCurLength += sizeof(long); ::memcpy(&(anAuthDataBuf->fBufferData[aCurLength]), inUserPassword,

aTempLength);

aCurLength += aTempLength;

anAuthBuff->fBufferLength = aDataBufSize;

aDirErr = dsDoDirNodeAuth(inDirNodeRef, anAuthType2Use, true, anAuthDataBuf, aAuthRespBuf, &aContinueData);

switch(aDirErr)

{

case eDSNoErr: aResult = true; break;

default:

//If any other error, assume the name or password is bad. aResult = false;

break;

}

// Clean up allocations.

aDirErr = dsDataBufferDeAllocate(inDirRef, anAuthDataBuf); anAuthDataBuf = NULL;

// Don't need to keep the response.

aDirErr = dsDataBufferDeAllocate(inDirRef, aAuthRespBuf); aAuthRespBuf = NULL;

//Don't need the authentication type value. Build a new one if needed

//later.

aDirErr = dsDataNodeDeAllocate(inDirRef, anAuthType2Use); anAuthType2Use = NULL;

//Return the result of the authentication. return (aResult);

}

Authenticating a User to a Node

31

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

Image 31
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 NodesWorking 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