<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 27.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMAccessoryOwnershipToken",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMAccessoryOwnershipToken"
  },
  "title" : "HMAccessoryOwnershipToken"
}
-->

# HMAccessoryOwnershipToken

Authentication data that your app provides when adding an accessory to a home.

```
class HMAccessoryOwnershipToken
```

## Overview

If you manufacture an accessory that requires user authentication to add the accessory to a home, manage the authentication in your app and produce a token that represents the successful outcome of that process. Wrap the token data in an [`HMAccessoryOwnershipToken`](/documentation/HomeKit/HMAccessoryOwnershipToken) instance and call the [`init(url:ownershipToken:)`](/documentation/HomeKit/HMAccessorySetupPayload/init(url:ownershipToken:)-32mrj) method to create an authenticated [`HMAccessorySetupPayload`](/documentation/HomeKit/HMAccessorySetupPayload) instance. Then call the [`addAndSetupAccessories(with:completionHandler:)`](/documentation/HomeKit/HMHome/addAndSetupAccessories(with:completionHandler:)) method with the payload.

If the user attempts from the Home app to add an accessory that requires a token, the Home app calls the associated app’s [`homeManager(_:didReceiveAddAccessoryRequest:)`](/documentation/HomeKit/HMHomeManagerDelegate/homeManager(_:didReceiveAddAccessoryRequest:)) home manager delegate method to perform the negotiation and provide the token.

## Topics

### Creating a Token

[`-  initWithData:`](/documentation/HomeKit/HMAccessoryOwnershipToken/init(data:))

Creates an ownership token from data.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)