Set HTTP headers on ASWebAuthenticationSession?

We need to append some values in the User-Agent HTTP header for our SSO flows. We use the ASWebAuthenticationSession class as you should, but I can't find any information on how to modify the headers in this web view.

I have tried setting the "global" user agent via

UserDefaults.standard.register(defaults: ["UserAgent": "fakeUserAgent"])

While it does change the User-Agent in WKWebView, it seemingly does not impact the ASWebAuthenticationSession.

There are also no configuration settings to change headers or User-Agent on ASWebAuthenticationSession.

Is it not possible by security design?

Replies

It is currently not possible to set headers for ASWebAuthenticationSession. But please feel free to send a Feedback describing your use case!