-
Notifications
You must be signed in to change notification settings - Fork 2
Add way to clear all AuthorizationManager state #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add way to clear all AuthorizationManager state #112
Conversation
| - Samples/Quickstart | ||
|
|
||
| ignore-rules: | ||
| - ios_log No newline at end of file |
There was a problem hiding this comment.
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.
There was a problem hiding this 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(), andresetConfiguration()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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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


Issue
#112 (review)