Restore the .oidcCallback route for external authentication. (#5391)

* Restore the .oidcCallback route (partially reverts #3461) for external authentication.

* Make sure OIDC also works for non-http URLs.

* Remove oidcAuthentication from the state machine.

There isn't a reliable way to detect failure/cancellation when e.g. the user returns from an external app without interacting with the MAS page.
This commit is contained in:
Doug
2026-05-05 12:47:07 +01:00
committed by GitHub
parent aaf81e00f3
commit fef942f529
17 changed files with 181 additions and 52 deletions
@@ -13,6 +13,7 @@ struct SoftLogoutScreenCoordinatorParameters {
let authenticationService: AuthenticationServiceProtocol
let credentials: SoftLogoutScreenCredentials
let keyBackupNeeded: Bool
let appMediator: AppMediatorProtocol
let appSettings: AppSettings
let userIndicatorController: UserIndicatorControllerProtocol
}
@@ -90,6 +91,15 @@ final class SoftLogoutScreenCoordinator: CoordinatorProtocol {
AnyView(SoftLogoutScreen(context: viewModel.context))
}
func handleOIDCRedirectURL(_ url: URL) {
guard let oidcPresenter else {
MXLog.error("Failed to find an OIDC request in progress.")
return
}
oidcPresenter.handleUniversalLinkCallback(url)
}
// MARK: - Private
private static let loadingIndicatorIdentifier = "\(SoftLogoutScreenCoordinator.self)-Loading"
@@ -149,6 +159,7 @@ final class SoftLogoutScreenCoordinator: CoordinatorProtocol {
let presenter = OIDCAuthenticationPresenter(authenticationService: parameters.authenticationService,
oidcRedirectURL: parameters.appSettings.oidcRedirectURL,
presentationAnchor: presentationAnchor,
appMediator: parameters.appMediator,
userIndicatorController: parameters.userIndicatorController)
self.oidcPresenter = presenter
switch await presenter.authenticate(using: oidcData) {