<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "OpenDirectory",
  "identifier" : "/documentation/OpenDirectory/ODNodeSetCredentials(_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Open Directory"
    ],
    "preciseIdentifier" : "c:@F@ODNodeSetCredentials"
  },
  "title" : "ODNodeSetCredentials(_:_:_:_:_:)"
}
-->

# ODNodeSetCredentials(_:_:_:_:_:)

Sets credentials for interacting with a node.

```
func ODNodeSetCredentials(_ node: ODNodeRef!, _ recordType: String!, _ recordName: CFString!, _ password: CFString!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Bool
```

## Parameters

`node`

The node.

`recordType`

The record type that uses the credentials. Can be `NULL`. The default value is `kODRecordTypeUsers`.

`recordName`

The username to use to authenticate with the node.

`password`

The password to use to authenticate with the node.

`error`

An error reference for error details. Can be `NULL`.

## Return Value

`true` if the credentials are successfully set; otherwise, `false`.

## Discussion

If this function fails, the previous credentials for the node are used.

This function sets credentials for all references to the node. If you only want to set credentials for a single record referencing the node, use [`ODRecordSetNodeCredentials(_:_:_:_:)`](/documentation/OpenDirectory/ODRecordSetNodeCredentials(_:_:_:_:)) instead.

## See Also

[Record Types](/documentation/OpenDirectory/record-types)

Types of Open Directory records.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)