<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: 17.4.0 -",
    "macOS: 14.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASWebAuthenticationSessionRequest/additionalHeaderFields",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "c:objc(cs)ASWebAuthenticationSessionRequest(py)additionalHeaderFields"
  },
  "title" : "additionalHeaderFields"
}
-->

# additionalHeaderFields

Additional headers to send when loading the initial URL.

```
var additionalHeaderFields: [String : String]? { get }
```

## Discussion

Apply these headers only to the initial page, and don’t overwrite any headers that the browser usually sends.

This example shows the call to the [`begin(_:)`](/documentation/AuthenticationServices/ASWebAuthenticationSessionWebBrowserSessionHandling/begin(_:)) delegate method when a web browser receives a request from an app. This implementation iterates over the additional header fields from the app’s request and adds them to its own request.

```swift
func begin(_ request: ASWebAuthenticationSessionRequest!) {
    self.request = request

    let urlRequest = URLRequest(url: request.url)
    // Use the new fields on the URL request.
    for (header, value) in request.additionalHeaderFields {
        urlRequest.addValue(value, forHTTPHeaderField: header)
    }

    // Load the URL request.
}
```

> Important: Your browser app needs to add `AdditionalHeaderFieldsAreSupported` with the value `YES` to the `ASWebAuthenticationSessionWebBrowserSupportCapabilities` dictionary in your app’s information property list to use this API. If the system doesn’t find this key in the default browser app, it sends the request to Safari instead.

---

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)