Repository navigation
Summary
This is the first AppAuth release distributed only through Swift Package Manager - 3.0.0 was the last release published to CocoaPods, so please see MIGRATING_FROM_COCOAPODS.md if you haven't moved yet. It fixes three crashes (cancelling sign-in on iOS, a JSON array from the token endpoint, and null values in discovery documents), adds HTTPS redirect URLs on iOS 17.4+, and adds an AppAuthTestHelpers product for faking AppAuth in your own tests.
Note that the new HTTPS redirect URLs (#978) support is covered by unit tests only. If you adopt it, please let us know how it goes, and file an issue if anything misbehaves. (Your app needs the webcredentials Associated Domains service for the redirect host; applinks alone isn't enough.)
Changelog
New Features
- Added support for HTTPS (universal link) redirect URLs on iOS 17.4+.
OIDExternalUserAgentIOSusesASWebAuthenticationSession's HTTPS callback for them instead of a custom scheme callback. Not yet tested end to end - see the note above. (#978)
Behaviour Changes
- Discovery documents with a JSON
nullor a non-string value in an optional URL-valued field no longer raiseNSInvalidArgumentException; the property reads asnil. The same value in a required URL field now fails withOIDErrorCodeInvalidDiscoveryDocument. Anauthorization_endpointthat does not parse now fails the document too, like the other required URL fields. Addresses issue #380. (#983) - Improved the state validation error messages to distinguish a missing
stateparameter from a mismatched one. The end session message now notes that a provider'send_session_endpointmay point at a legacy or SAML single-logout endpoint, which does not echostate. Addresses issue #956. (#977) - Deprecated
OIDAuthorizationService.configuration. It is never set and is alwaysnil; use the request'sconfigurationinstead. It will be removed in 4.0. (#990) - Deprecated CocoaPods distribution. See details above. Addresses issue #962. (#986)
Crash & Flow-logic Fixes
- Fixed
OIDExternalUserAgentIOSCustomBrowserfailing the flow with "Unable to open Safari." whencanOpenURL:returnsNOfor a URL that the system can open, for example an https URL when Safari is restricted and another browser is the default. The flow now fails only if the URL really cannot be opened. Addresses issue #980. (#981) - Fixed a crash when the user cancels sign-in on iOS, caused by
ASWebAuthenticationSessionbeing deallocated during its completion handler or dismiss animation. Based on #917 by @Prash88. (#985) - Fixed a crash (
NSInvalidArgumentException) when a token, registration or device authorization endpoint answers with a JSON array instead of an object. The callback now gets an error. Addresses issue #987. (#988)
Testability Improvements
- Added the
AppAuthTestHelpersSwift package product, withOIDFakeAuthorizationServiceandOIDFakeExternalUserAgentSession, for testing code that depends on AppAuth. (#992, #993) - Added
OIDExternalUserAgentIOSCustomBrowserURLOpenerand-[OIDExternalUserAgentIOSCustomBrowser initWithURLTransformation:canOpenURLScheme:appStoreURL:URLOpener:]so an app can supply the object that opens URLs instead ofUIApplication. The existing initializers keep usingUIApplication. (#984) - Added instance-method counterparts of the
OIDAuthorizationServiceclass methods, and made-initpublic, so the service can be injected and faked in tests.OIDAuthorizationServiceProtocoldeclares them, andOIDAuthorizationServiceIOSProtocol/OIDAuthorizationServiceMacProtocoldeclare the platform convenience methods. (#990, #997) - Added instance-method counterparts of the iOS and macOS
OIDAuthorizationServiceconvenience methods, and read-onlypresentingViewController/presentingWindowproperties on the external user agents. (#991)