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

# ODRecordSetNodeCredentials(_:_:_:_:)

Sets node authentication credentials for a given record.

```
func ODRecordSetNodeCredentials(_ record: ODRecordRef!, _ username: CFString!, _ password: CFString!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Bool
```

## Parameters

`record`

The record.

`username`

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 you want to set credentials for all references to a node, use [`ODNodeSetCredentials(_:_:_:_:_:)`](/documentation/OpenDirectory/ODNodeSetCredentials(_:_:_:_:_:)) instead.

If this function fails, the previous credentials are used.

---

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)