<!--
{
  "availability" : [
    "iOS: 26.2.0 -",
    "iPadOS: 26.2.0 -",
    "macCatalyst: 26.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WiFiInfrastructure",
  "identifier" : "/documentation/WiFiInfrastructure/WINetworkSharingController/requestAuthorization()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Wi-Fi Infrastructure"
    ],
    "preciseIdentifier" : "s:18WiFiInfrastructure26WINetworkSharingControllerC20requestAuthorizationAC0H5StateOyYaKF"
  },
  "title" : "requestAuthorization()"
}
-->

# requestAuthorization()

Requests network-sharing authorization for the specified accessory at initial setup.

```
func requestAuthorization() async throws -> WINetworkSharingController.AuthorizationState
```

## Return Value

An [`WINetworkSharingController.AuthorizationState`](/documentation/WiFiInfrastructure/WINetworkSharingController/AuthorizationState) value indicating the authorization level the person selected.

## Discussion

Call this method to request that the system ask the person to authorize sharing of Wi-Fi networks
to the specified accessory. The person or the system may decline the request.

The person can select from the following sharing modes:

- **Automatically Share**: The system automatically sends new networks to the accessory when the device joins them while the accessory is connected.
- **Ask Every Time**: When the device joins a new network, the system notifies your extension through the Wi-Fi Infrastructure framework. Your extension can then check [`newShareableNetworkAvailable`](/documentation/WiFiInfrastructure/WINetworkSharingProvider/NetworkEvent/newShareableNetworkAvailable) and call [`presentAskToShareUI(scanProvider:)`](/documentation/WiFiInfrastructure/WINetworkSharingProvider/presentAskToShareUI(scanProvider:)) to present UI asking the person to share that network.
- **Don’t Share**: The person declines to share Wi-Fi networks with this accessory.

In the “Automatically Share” and “Ask Every Time” sharing modes, the accessory may request to share a nearby network that’s known to the person. Accessories can use this to prompt a person to share a different network if they have trouble connecting to a previously shared network.

> Throws:
> 
> - `accessoryTransportNotSecured` if the accessory is not using a secure Bluetooth transport.
> - `accessoryNotConnected` if the accessory isn’t connected when your container app calls this method.
> - `WINetworkSharingError` if other faults occur.

---

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)