Skip to content

Commit 3479406

Browse files
authored
Send full user agent header to server during OIDC authentication and when viewing Account and Device management screens (#7997)
1 parent acfac7c commit 3479406

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Riot/Modules/Authentication/SSO/SSOAuthentificationSession.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import Foundation
99
import AuthenticationServices
10+
import MatrixSDK
1011

1112
/// Provides context to target where in an application's UI the authorization view should be shown.
1213
class SSOAuthenticationSessionContextProvider: NSObject, SSOAuthenticationSessionContextProviding, ASWebAuthenticationPresentationContextProviding {
@@ -62,6 +63,14 @@ final class SSOAuthentificationSession: SSOAuthentificationSessionProtocol {
6263
authentificationSession.presentationContextProvider = asWebContextProvider
6364
}
6465

66+
if #available(iOS 17.4, *),
67+
let httpAdditionalHeaders = MXSDKOptions.sharedInstance().httpAdditionalHeaders,
68+
let userAgent = httpAdditionalHeaders["User-Agent"] {
69+
authentificationSession.additionalHeaderFields = [
70+
"X-Element-User-Agent": userAgent
71+
]
72+
}
73+
6574
authentificationSession.start()
6675
}
6776

0 commit comments

Comments
 (0)