From a477d9ab7134ea52f8d88bbf2b305570eeba839a Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Wed, 29 Nov 2023 20:14:00 +0100 Subject: [PATCH 01/11] Update OIDExternalUserAgentIOS.m to weakify presentingViewController --- Source/AppAuth/iOS/OIDExternalUserAgentIOS.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m index 4a8cda0a3..3b8b75be8 100644 --- a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m +++ b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m @@ -42,7 +42,7 @@ @interface OIDExternalUserAgentIOS () #endif @implementation OIDExternalUserAgentIOS { - UIViewController *_presentingViewController; + __weak UIViewController *_presentingViewController; BOOL _prefersEphemeralSession; BOOL _externalUserAgentFlowInProgress; @@ -225,6 +225,7 @@ - (void)dismissExternalUserAgentAnimated:(BOOL)animated completion:(void (^)(voi - (void)cleanUp { // The weak references to |_safariVC| and |_session| are set to nil to avoid accidentally using // them while not in an authorization flow. + _presentingViewController = nil; _safariVC = nil; _authenticationVC = nil; _webAuthenticationVC = nil; From 830d347d4bd5435788d71b19a2cf1030fe836188 Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Wed, 29 Nov 2023 20:41:40 +0100 Subject: [PATCH 02/11] Update AppAuth.podspec --- AppAuth.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppAuth.podspec b/AppAuth.podspec index b175e6282..b8e21d02e 100644 --- a/AppAuth.podspec +++ b/AppAuth.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| - s.name = "AppAuth" + s.name = "ORF-AppAuth" s.version = "1.6.2" s.summary = "AppAuth for iOS and macOS is a client SDK for communicating with OAuth 2.0 and OpenID Connect providers." From 10741e575edffc0e7266d2556be56cea573419be Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Wed, 29 Nov 2023 20:48:03 +0100 Subject: [PATCH 03/11] Update AppAuth.podspec --- AppAuth.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppAuth.podspec b/AppAuth.podspec index b8e21d02e..b175e6282 100644 --- a/AppAuth.podspec +++ b/AppAuth.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| - s.name = "ORF-AppAuth" + s.name = "AppAuth" s.version = "1.6.2" s.summary = "AppAuth for iOS and macOS is a client SDK for communicating with OAuth 2.0 and OpenID Connect providers." From 69b44a0f05efb3b3d0da289802d5e9f0dec14733 Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Wed, 13 Dec 2023 11:08:00 +0100 Subject: [PATCH 04/11] Update OIDExternalUserAgentIOS.m --- Source/AppAuth/iOS/OIDExternalUserAgentIOS.m | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m index 3b8b75be8..a352d03b4 100644 --- a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m +++ b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m @@ -225,7 +225,6 @@ - (void)dismissExternalUserAgentAnimated:(BOOL)animated completion:(void (^)(voi - (void)cleanUp { // The weak references to |_safariVC| and |_session| are set to nil to avoid accidentally using // them while not in an authorization flow. - _presentingViewController = nil; _safariVC = nil; _authenticationVC = nil; _webAuthenticationVC = nil; From 2ee12ea9f9dcb35c79881d44f11a4a3fd4246d25 Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:17:32 +0100 Subject: [PATCH 05/11] Update OIDAuthState.m --- Source/AppAuthCore/OIDAuthState.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/AppAuthCore/OIDAuthState.m b/Source/AppAuthCore/OIDAuthState.m index cb5a22a1e..008961a44 100644 --- a/Source/AppAuthCore/OIDAuthState.m +++ b/Source/AppAuthCore/OIDAuthState.m @@ -57,7 +57,11 @@ /*! @brief Number of seconds the access token is refreshed before it actually expires. */ +#if DEBUG +static const NSUInteger kExpiryTimeTolerance = 15; +#else static const NSUInteger kExpiryTimeTolerance = 60; +#endif /*! @brief Object to hold OIDAuthState pending actions. */ From bd5099c88fce2a4ed0909cb88af3296b7f4c538b Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:39:56 +0100 Subject: [PATCH 06/11] Update OIDAuthState.m --- Source/AppAuthCore/OIDAuthState.m | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Source/AppAuthCore/OIDAuthState.m b/Source/AppAuthCore/OIDAuthState.m index 008961a44..7d692b1ae 100644 --- a/Source/AppAuthCore/OIDAuthState.m +++ b/Source/AppAuthCore/OIDAuthState.m @@ -57,11 +57,6 @@ /*! @brief Number of seconds the access token is refreshed before it actually expires. */ -#if DEBUG -static const NSUInteger kExpiryTimeTolerance = 15; -#else -static const NSUInteger kExpiryTimeTolerance = 60; -#endif /*! @brief Object to hold OIDAuthState pending actions. */ From f330fc54bf58fe576182907165182d87f256c88d Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:40:33 +0100 Subject: [PATCH 07/11] Update OIDAuthState.h --- Source/AppAuthCore/OIDAuthState.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/AppAuthCore/OIDAuthState.h b/Source/AppAuthCore/OIDAuthState.h index 46c78a831..606e8723f 100644 --- a/Source/AppAuthCore/OIDAuthState.h +++ b/Source/AppAuthCore/OIDAuthState.h @@ -30,6 +30,13 @@ NS_ASSUME_NONNULL_BEGIN +#if DEBUG +static const NSUInteger kExpiryTimeTolerance = 15; +#else +static const NSUInteger kExpiryTimeTolerance = 60; +#endif + + /*! @brief Represents a block used to call an action with a fresh access token. @param accessToken A valid access token if available. @param idToken A valid ID token if available. From 5c6e84621af96b2fe0c66cc4fcf8b2ff120a5363 Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:44:25 +0200 Subject: [PATCH 08/11] Update OIDExternalUserAgentIOS.m --- Source/AppAuth/iOS/OIDExternalUserAgentIOS.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m index a352d03b4..3f80fa821 100644 --- a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m +++ b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m @@ -42,7 +42,7 @@ @interface OIDExternalUserAgentIOS () #endif @implementation OIDExternalUserAgentIOS { - __weak UIViewController *_presentingViewController; +// UIViewController *_presentingViewController; BOOL _prefersEphemeralSession; BOOL _externalUserAgentFlowInProgress; @@ -55,7 +55,7 @@ @implementation OIDExternalUserAgentIOS { #pragma clang diagnostic pop } -- (null_unspecified instancetype)init { +- (nullable instancetype)init { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnonnull" return [self initWithPresentingViewController:nil]; @@ -71,7 +71,7 @@ - (nullable instancetype)initWithPresentingViewController: @"presentingViewController cannot be nil on iOS 13"); #endif // __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 - _presentingViewController = presentingViewController; + self._presentingViewController = presentingViewController; } return self; } @@ -166,12 +166,12 @@ - (BOOL)presentExternalUserAgentRequest:(id)request } // iOS 9 and 10, use SFSafariViewController if (@available(iOS 9.0, *)) { - if (!openedUserAgent && _presentingViewController) { + if (!openedUserAgent && self._presentingViewController) { SFSafariViewController *safariVC = [[SFSafariViewController alloc] initWithURL:requestURL]; safariVC.delegate = self; _safariVC = safariVC; - [_presentingViewController presentViewController:safariVC animated:YES completion:nil]; + [self._presentingViewController presentViewController:safariVC animated:YES completion:nil]; openedUserAgent = YES; } } @@ -255,7 +255,7 @@ - (void)safariViewControllerDidFinish:(SFSafariViewController *)controller NS_AV #pragma mark - ASWebAuthenticationPresentationContextProviding - (ASPresentationAnchor)presentationAnchorForWebAuthenticationSession:(ASWebAuthenticationSession *)session API_AVAILABLE(ios(13.0)){ - return _presentingViewController.view.window; + return self._presentingViewController.view.window; } #endif // __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 From 4e4a3a160fa34aab8c840e4e8e89fa2271bbca8c Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:44:55 +0200 Subject: [PATCH 09/11] Update OIDExternalUserAgentIOS.h --- Source/AppAuth/iOS/OIDExternalUserAgentIOS.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.h b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.h index 12abc203c..a2cabb09f 100644 --- a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.h +++ b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.h @@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN */ API_UNAVAILABLE(macCatalyst) @interface OIDExternalUserAgentIOS : NSObject +@property(nonatomic, weak) UIViewController *_presentingViewController; - (null_unspecified instancetype)init API_AVAILABLE(ios(11)) __deprecated_msg("This method will not work on iOS 13, use " From 5793d7a736fe3cdc42292bed0726120fb73f9644 Mon Sep 17 00:00:00 2001 From: Osama Fawzi <55601604+Osama-Fawzi@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:49:02 +0200 Subject: [PATCH 10/11] Update OIDExternalUserAgentIOS.m --- Source/AppAuth/iOS/OIDExternalUserAgentIOS.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m index 3f80fa821..afea5aef4 100644 --- a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m +++ b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m @@ -55,7 +55,7 @@ @implementation OIDExternalUserAgentIOS { #pragma clang diagnostic pop } -- (nullable instancetype)init { +- (null_unspecified instancetype)init { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnonnull" return [self initWithPresentingViewController:nil]; From ef9303c534de7f24a2c7fb837d707c818f720a7b Mon Sep 17 00:00:00 2001 From: Osama Fawzi Date: Fri, 18 Apr 2025 09:54:57 +0200 Subject: [PATCH 11/11] cleaning up --- Source/AppAuth/iOS/OIDExternalUserAgentIOS.m | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m index afea5aef4..c0ed5dcaa 100644 --- a/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m +++ b/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m @@ -42,7 +42,6 @@ @interface OIDExternalUserAgentIOS () #endif @implementation OIDExternalUserAgentIOS { -// UIViewController *_presentingViewController; BOOL _prefersEphemeralSession; BOOL _externalUserAgentFlowInProgress;