---
title: HMAccessoryOwnershipToken
framework: homekit
role: symbol
role_heading: Class
path: homekit/hmaccessoryownershiptoken
---

# HMAccessoryOwnershipToken

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

## Declaration

```swift
class HMAccessoryOwnershipToken
```

## Overview

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 instance and call the init(url:ownershipToken:) method to create an authenticated HMAccessorySetupPayload instance. Then call the 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:) home manager delegate method to perform the negotiation and provide the token.

## Topics

### Creating a Token

- [init(data:)](homekit/hmaccessoryownershiptoken/init(data:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Creating a Payload

- [init(url:)](homekit/hmaccessorysetuppayload/init(url:)-7ytm5.md)
- [init(url:ownershipToken:)](homekit/hmaccessorysetuppayload/init(url:ownershiptoken:)-32mrj.md)
