Skip to content

Conversation

@mrudatsprint
Copy link
Contributor

@mrudatsprint mrudatsprint commented Dec 16, 2025

@mrudatsprint mrudatsprint linked an issue Dec 16, 2025 that may be closed by this pull request
- Samples/Quickstart

ignore-rules:
- ios_log No newline at end of file
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore the logging of sensitive information in the sample application.

@mrudatsprint mrudatsprint requested a review from Copilot January 5, 2026 20:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds functionality to clear all AuthorizationManager state and switch between different FusionAuth configurations at runtime. The changes enable multi-tenant support by allowing apps to reset configuration and authentication state when switching between different FusionAuth instances or tenants.

  • New clearAllState(), getConfiguration(), and resetConfiguration() methods in AuthorizationManager
  • Made AuthorizationConfiguration properties public for external access
  • Added comprehensive test coverage for configuration switching scenarios
  • Updated Quickstart sample app to demonstrate tenant switching with UI controls

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Sources/FusionAuth/AuthorizationManager.swift Adds methods to clear state, retrieve and reset configuration
Sources/FusionAuth/AuthorizationConfiguration.swift Makes struct properties public for external access
Sources/FusionAuth/oauth/OAuthAuthorizationService.swift Adds internal cache clearing method
Tests/FusionAuthTests/AuthManager*StorageTest.swift Adds comprehensive tests for configuration management across storage types
Samples/Quickstart/Quickstart/ConfigurationManager.swift New utility for managing configuration switching in sample app
Samples/Quickstart/Quickstart/HomeView.swift Adds UI controls for configuration switching
Samples/Quickstart/Quickstart/LoggedInView.swift Displays active configuration information
Samples/Quickstart/Quickstart/FusionAuthStateObject.swift Tracks current configuration name
Samples/Quickstart/QuickstartTests/QuickstartTests.swift Adds UI tests for tenant switching functionality
Samples/Quickstart/fusionauth/*/kickstart/kickstart.json Updates test data with alternative tenant configuration
CONTRIBUTING.md Fixes repository references from Android to Swift SDK
.mobsf.yml Adds configuration for mobile security scanner
.github/workflows/mobsf.yml Updates workflow to use mobsf configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import FusionAuth

struct HomeView: View {
@EnvironmentObject private var authState: FusionAuthStateObject
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the new HomeView where the Active Configuration is displayed along with the Reset Configuration button.
new-Simulator Screenshot - iPhone 17 - 2025-12-29 at 09 32 30

Here's the old HomeView:
old-Simulator Screenshot - iPhone 17 - 2025-12-29 at 09 14 19

Copy link
Contributor Author

@mrudatsprint mrudatsprint Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyleschemmerling I'm going to update the UI in the Android SDK Sample Application to have the same display for the Active Configuration Header and the Reset Configuration button location. The functionality is in the Android SDK and the Sample Application's should look the same between each repository.

// MARK: - New End to End Test

@MainActor
func testSwitchToAlternateConfigAndLogin() throws {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The end to end test that reset's the configuration by changing to the Alternate Tenant

Here's a video that displays the functionality. Note, the Tenant changes in the Active Configuration when logging into the Alternate Tenant

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-01-06.at.10.34.30.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add way to clear all AuthorizationManager state

2 participants