Rename OIDC to OAuth. (#5525)

* Rename OIDC to OAuth.

* Update the enterprise submodule.
This commit is contained in:
Doug
2026-05-05 14:07:06 +01:00
committed by GitHub
parent e371903204
commit 0acbc41432
57 changed files with 402 additions and 400 deletions
@@ -276,11 +276,11 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
case .accountProvisioningLink:
handleAppRoute(route,
windowType: windowType)
case .oidcCallback(let url):
case .oAuthCallback(let url):
if stateMachine.state == .softLogout {
softLogoutCoordinator?.handleOIDCRedirectURL(url)
softLogoutCoordinator?.handleOAuthCallbackURL(url)
} else {
authenticationFlowCoordinator?.handleOIDCRedirectURL(url)
authenticationFlowCoordinator?.handleOAuthCallbackURL(url)
}
case .userProfile(let userID):
if isExternalURL {
@@ -14,9 +14,9 @@ import MatrixRustSDK
enum AppRoute: Hashable {
/// An account provisioning link generated externally.
case accountProvisioningLink(AccountProvisioningParameters)
/// An external callback used to complete login with OIDC. This is only used when authentication
/// requires an external app so cannot be done within the built in web authentication session.
case oidcCallback(url: URL)
/// An external callback used to complete login with OAuth. This is only used when authentication
/// requires an external app so cannot be handled directly by the web authentication session.
case oAuthCallback(url: URL)
/// The app's home screen.
case roomList
@@ -61,7 +61,7 @@ enum AppRoute: Hashable {
var isAuthenticationRoute: Bool {
switch self {
case .accountProvisioningLink: true
case .oidcCallback: true
case .oAuthCallback: true
default: false
}
}
@@ -87,7 +87,7 @@ struct AppRouteURLParser {
MatrixPermalinkParser(),
ElementWebURLParser(domains: appSettings.elementWebHosts),
AccountProvisioningURLParser(domain: appSettings.accountProvisioningHost),
OIDCCallbackURLParser(redirectURL: appSettings.oidcRedirectURL)
OAuthCallbackURLParser(redirectURL: appSettings.oAuthRedirectURL)
]
}
@@ -204,12 +204,12 @@ private struct AccountProvisioningURLParser: URLParser {
}
}
/// The parser for the OIDC callback URL. This always returns a `.oidcCallback`.
struct OIDCCallbackURLParser: URLParser {
/// The parser for the OAuth callback URL. This always returns an `.oAuthCallback`.
struct OAuthCallbackURLParser: URLParser {
let redirectURL: URL
func route(from url: URL) -> AppRoute? {
guard url.absoluteString.starts(with: redirectURL.absoluteString) else { return nil }
return .oidcCallback(url: url)
return .oAuthCallback(url: url)
}
}
@@ -135,7 +135,7 @@ final class AppSettings {
allowOtherAccountProviders: Bool,
hideBrandChrome: Bool,
pushGatewayBaseURL: URL,
oidcRedirectURL: URL,
oAuthRedirectURL: URL,
websiteURL: URL,
logoURL: URL,
copyrightURL: URL,
@@ -155,7 +155,7 @@ final class AppSettings {
self.allowOtherAccountProviders = allowOtherAccountProviders
self.hideBrandChrome = hideBrandChrome
self.pushGatewayBaseURL = pushGatewayBaseURL
self.oidcRedirectURL = oidcRedirectURL
self.oAuthRedirectURL = oAuthRedirectURL
self.websiteURL = websiteURL
self.logoURL = logoURL
self.copyrightURL = copyrightURL
@@ -249,19 +249,19 @@ final class AppSettings {
// MARK: - Authentication
/// Any pre-defined static client registrations for OIDC issuers.
let oidcStaticRegistrations: [URL: String] = ["https://id.thirdroom.io/realms/thirdroom": "elementx"]
/// The redirect URL used for OIDC. For the normal case we don't actually need the bundle ID as the web authentication session handles the redirect internally.
/// Any pre-defined static client registrations for OAuth issuers.
let oAuthStaticRegistrations: [URL: String] = ["https://id.thirdroom.io/realms/thirdroom": "elementx"]
/// The redirect URL used for OAuth. For the normal case we don't actually need the bundle ID as the web authentication session handles the redirect internally.
/// However in the case where MAS sends the user to an external app, we need to make sure that the system will open the correct variant of the app (e.g. Nightly).
private(set) var oidcRedirectURL: URL! = URL(string: "https://element.io/oauth/ios/\(InfoPlistReader.main.bundleIdentifier)")
private(set) var oAuthRedirectURL: URL! = URL(string: "https://element.io/oauth/ios/\(InfoPlistReader.main.bundleIdentifier)")
private(set) lazy var oidcConfiguration = OIDCConfiguration(clientName: InfoPlistReader.main.bundleDisplayName,
redirectURI: oidcRedirectURL,
clientURI: websiteURL,
logoURI: logoURL,
tosURI: acceptableUseURL,
policyURI: privacyURL,
staticRegistrations: oidcStaticRegistrations.mapKeys { $0.absoluteString })
private(set) lazy var oAuthConfiguration = OAuthConfiguration(clientName: InfoPlistReader.main.bundleDisplayName,
redirectURI: oAuthRedirectURL,
clientURI: websiteURL,
logoURI: logoURL,
tosURI: acceptableUseURL,
policyURI: privacyURL,
staticRegistrations: oAuthStaticRegistrations.mapKeys { $0.absoluteString })
/// Whether or not the Create Account button is shown on the start screen.
///
@@ -0,0 +1,36 @@
//
// Copyright 2025 Element Creations Ltd.
// Copyright 2024-2025 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import Foundation
import MatrixRustSDK
struct OAuthConfiguration {
let clientName: String
let redirectURI: URL
let clientURI: URL
let logoURI: URL
let tosURI: URL
let policyURI: URL
let staticRegistrations: [String: String]
}
#if canImport(MatrixRustSDK)
import MatrixRustSDK
extension OAuthConfiguration {
var rustValue: MatrixRustSDK.OAuthConfiguration {
MatrixRustSDK.OAuthConfiguration(clientName: clientName,
redirectUri: redirectURI.absoluteString,
clientUri: clientURI.absoluteString,
logoUri: logoURI.absoluteString,
tosUri: tosURI.absoluteString,
policyUri: policyURI.absoluteString,
staticRegistrations: staticRegistrations)
}
}
#endif
@@ -1,35 +0,0 @@
//
// Copyright 2025 Element Creations Ltd.
// Copyright 2024-2025 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import Foundation
struct OIDCConfiguration {
let clientName: String
let redirectURI: URL
let clientURI: URL
let logoURI: URL
let tosURI: URL
let policyURI: URL
let staticRegistrations: [String: String]
}
#if canImport(MatrixRustSDK)
import MatrixRustSDK
extension OIDCConfiguration {
var rustValue: OAuthConfiguration {
OAuthConfiguration(clientName: clientName,
redirectUri: redirectURI.absoluteString,
clientUri: clientURI.absoluteString,
logoUri: logoURI.absoluteString,
tosUri: tosURI.absoluteString,
policyUri: policyURI.absoluteString,
staticRegistrations: staticRegistrations)
}
}
#endif