diff --git a/AppAuth.xcodeproj/project.pbxproj b/AppAuth.xcodeproj/project.pbxproj index baf27bf61..542cc7bfa 100644 --- a/AppAuth.xcodeproj/project.pbxproj +++ b/AppAuth.xcodeproj/project.pbxproj @@ -401,10 +401,6 @@ A5EEF29A20D821960044F470 /* OIDTokenUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */; }; A5EEF29B20D821970044F470 /* OIDTokenUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */; }; A5EEF29C20D821970044F470 /* OIDTokenUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */; }; - A6339DAA20321ADD0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6339DAB20321AE50043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6339DAC20321AE70043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6339DAD20321AEB0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; A6DEAB9B2018E4AD0022AC32 /* OIDExternalUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgent.h */; settings = {ATTRIBUTES = (Public, ); }; }; A6DEAB9C2018E4AD0022AC32 /* OIDExternalUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgent.h */; settings = {ATTRIBUTES = (Public, ); }; }; A6DEAB9D2018E4AD0022AC32 /* OIDExternalUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgent.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -607,7 +603,6 @@ 60140F841DE43C8C00DA0DC3 /* OIDRegistrationResponseTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OIDRegistrationResponseTests.h; sourceTree = ""; }; 60140F851DE43CC700DA0DC3 /* OIDRegistrationResponseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OIDRegistrationResponseTests.m; sourceTree = ""; }; A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OIDTokenUtilitiesTests.m; sourceTree = ""; }; - A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDAuthorizationFlowSession.h; sourceTree = ""; }; A6DEAB982018E4A20022AC32 /* OIDExternalUserAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgent.h; sourceTree = ""; }; A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgentSession.h; sourceTree = ""; }; A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgentRequest.h; sourceTree = ""; }; @@ -783,7 +778,6 @@ 340DAE241D581FE700EC285B /* macOS */, F6F60FAF1D2BFEF000325CB3 /* iOS */, 341741AF1C5D8243000EF209 /* AppAuth.h */, - A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */, 341741B41C5D8243000EF209 /* OIDAuthorizationRequest.h */, 341741B51C5D8243000EF209 /* OIDAuthorizationRequest.m */, 341741B61C5D8243000EF209 /* OIDAuthorizationResponse.h */, @@ -963,7 +957,6 @@ 343AAAF91E83499000F9D36E /* OIDTokenUtilities.h in Headers */, 343AAAEC1E83499000F9D36E /* OIDError.h in Headers */, A6DEABAB2018E5C50022AC32 /* OIDExternalUserAgentIOS.h in Headers */, - A6339DAA20321ADD0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -993,7 +986,6 @@ 343AAAFC1E83499100F9D36E /* OIDAuthorizationResponse.h in Headers */, 343AAB0C1E83499100F9D36E /* OIDScopeUtilities.h in Headers */, 55A094D020DFBB11000045D1 /* OIDURLSessionProvider.h in Headers */, - A6339DAB20321AE50043D1C9 /* OIDAuthorizationFlowSession.h in Headers */, 343AAB011E83499100F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, 343AAAFB1E83499100F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAB051E83499100F9D36E /* OIDErrorUtilities.h in Headers */, @@ -1026,7 +1018,6 @@ 343AAB141E83499200F9D36E /* OIDAuthorizationResponse.h in Headers */, 343AAB241E83499200F9D36E /* OIDScopeUtilities.h in Headers */, 55A094D120DFBB12000045D1 /* OIDURLSessionProvider.h in Headers */, - A6339DAC20321AE70043D1C9 /* OIDAuthorizationFlowSession.h in Headers */, 343AAB191E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, 343AAB131E83499200F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAB1D1E83499200F9D36E /* OIDErrorUtilities.h in Headers */, @@ -1060,7 +1051,6 @@ 343AAAE11E83494A00F9D36E /* OIDLoopbackHTTPServer.h in Headers */, 343AAB311E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, 343AAB2F1E83499200F9D36E /* OIDAuthState.h in Headers */, - A6339DAD20321AEB0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */, 343AAB3E1E83499200F9D36E /* OIDServiceDiscovery.h in Headers */, A6DEAB9E2018E4AE0022AC32 /* OIDExternalUserAgent.h in Headers */, 34A6632C1E871DD40060B664 /* OIDIDToken.h in Headers */, diff --git a/Source/AppAuth.h b/Source/AppAuth.h index dd30d9935..e7f7faa61 100644 --- a/Source/AppAuth.h +++ b/Source/AppAuth.h @@ -19,7 +19,6 @@ #import "OIDAuthState.h" #import "OIDAuthStateChangeDelegate.h" #import "OIDAuthStateErrorDelegate.h" -#import "OIDAuthorizationFlowSession.h" #import "OIDAuthorizationRequest.h" #import "OIDAuthorizationResponse.h" #import "OIDAuthorizationService.h" diff --git a/Source/Framework/AppAuth.h b/Source/Framework/AppAuth.h index 7cba488ca..4541a1ced 100644 --- a/Source/Framework/AppAuth.h +++ b/Source/Framework/AppAuth.h @@ -27,7 +27,6 @@ FOUNDATION_EXPORT const unsigned char AppAuthVersionString[]; #import #import #import -#import #import #import #import diff --git a/Source/OIDAuthState.h b/Source/OIDAuthState.h index 3a98d378a..6af06b285 100644 --- a/Source/OIDAuthState.h +++ b/Source/OIDAuthState.h @@ -23,7 +23,6 @@ @class OIDRegistrationResponse; @class OIDTokenResponse; @class OIDTokenRequest; -@protocol OIDAuthorizationFlowSession; @protocol OIDAuthStateChangeDelegate; @protocol OIDAuthStateErrorDelegate; @protocol OIDExternalUserAgent; @@ -149,7 +148,7 @@ typedef void (^OIDAuthStateAuthorizationCallback)(OIDAuthState *_Nullable authSt receives a @c OIDExternalUserAgentSession.cancel message, or after processing a @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest externalUserAgent:(id)externalUserAgent callback:(OIDAuthStateAuthorizationCallback)callback; @@ -274,16 +273,6 @@ typedef void (^OIDAuthStateAuthorizationCallback)(OIDAuthState *_Nullable authSt - (nullable OIDTokenRequest *)tokenRefreshRequestWithAdditionalParameters: (nullable NSDictionary *)additionalParameters; -/*! @brief Deprecated, use @c OIDAuthState.performActionWithFreshTokens:. - @discussion Calls the block with a valid access token (refreshing it first, if needed), or if a - refresh was needed and failed, with the error that caused it to fail. - @param action The block to execute with a fresh token. This block will be executed on the main - thread. - @deprecated Use @c OIDAuthState.performActionWithFreshTokens: which is equivalent. - */ -- (void)withFreshTokensPerformAction:(OIDAuthStateAction)action - __deprecated_msg("Use OIDAuthState.performActionWithFreshTokens:"); - @end NS_ASSUME_NONNULL_END diff --git a/Source/OIDAuthState.m b/Source/OIDAuthState.m index 8b141a667..d8c4f7566 100644 --- a/Source/OIDAuthState.m +++ b/Source/OIDAuthState.m @@ -105,12 +105,12 @@ @implementation OIDAuthState #pragma mark - Convenience initializers -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest externalUserAgent:(id)externalUserAgent callback:(OIDAuthStateAuthorizationCallback)callback { // presents the authorization request - id authFlowSession = [OIDAuthorizationService + id authFlowSession = [OIDAuthorizationService presentAuthorizationRequest:authorizationRequest externalUserAgent:externalUserAgent callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse, @@ -507,12 +507,6 @@ - (void)performActionWithFreshTokens:(OIDAuthStateAction)action }]; } -#pragma mark - Deprecated - -- (void)withFreshTokensPerformAction:(OIDAuthStateAction)action { - [self performActionWithFreshTokens:action additionalRefreshParameters:nil]; -} - #pragma mark - /*! @fn isTokenFresh diff --git a/Source/OIDAuthorizationFlowSession.h b/Source/OIDAuthorizationFlowSession.h deleted file mode 100644 index 78903f6c7..000000000 --- a/Source/OIDAuthorizationFlowSession.h +++ /dev/null @@ -1,44 +0,0 @@ -/*! @file OIDAuthorizationRequest.h - @brief AppAuth iOS SDK - @copyright - Copyright 2015 Google Inc. All Rights Reserved. - @copydetails - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/*! @brief Represents an in-flight authorization flow session. - @deprecated Use the more generic OIDExternalUserAgentSession instead. - */ -__attribute__((deprecated("Use the more generic OIDExternalUserAgentSession instead."))) -@protocol OIDAuthorizationFlowSession - -/*! @brief Clients should call this method with the result of the authorization code flow if it - becomes available. - @param URL The redirect URL invoked by the authorization server. - @discussion When the URL represented a valid authorization response, implementations - should clean up any left-over UI state from the authorization, for example by - closing the \SFSafariViewController or looback HTTP listener if those were used. - The completion block of the pending authorization request should then be invoked. - @remarks Has no effect if called more than once, or after a @c cancel message was received. - @return YES if the passed URL matches the expected redirect URL and was consumed, NO otherwise. - */ -- (BOOL)resumeAuthorizationFlowWithURL:(NSURL *)URL; - -/*! @brief @c OIDExternalUserAgent implementations should call this method when the - authorization flow failed with a non-OAuth error. - @param error The error that is the reason for the failure of this authorization flow. - @remarks Has no effect if called more than once, or after a @c cancel message was received. - */ -- (void)failAuthorizationFlowWithError:(NSError *)error; - -@end diff --git a/Source/OIDAuthorizationRequest.h b/Source/OIDAuthorizationRequest.h index 5c30f2bf6..121f09bba 100644 --- a/Source/OIDAuthorizationRequest.h +++ b/Source/OIDAuthorizationRequest.h @@ -193,37 +193,6 @@ extern NSString *const OIDOAuthorizationRequestCodeChallengeMethodS256; responseType:(NSString *)responseType additionalParameters:(nullable NSDictionary *)additionalParameters; -/*! @brief Deprecated, replaced with @c OIDAuthState.initWithConfiguration:clientId:clientSecret:scope:redirectURL:responseType:state:nonce:codeVerifier:codeChallenge:codeChallengeMethod:additionalParameters:. - @param configuration The service's configuration. - @param clientID The client identifier. - @param scope A scope string per the OAuth2 spec (a space-delimited set of scopes). - @param redirectURL The client's redirect URI. - @param responseType The expected response type. - @param state An opaque value used by the client to maintain state between the request and - callback. - @param codeVerifier The PKCE code verifier. See @c OIDAuthorizationRequest.generateCodeVerifier. - @param codeChallenge The PKCE code challenge, calculated from the code verifier such as with - @c OIDAuthorizationRequest.codeChallengeS256ForVerifier:. - @param codeChallengeMethod The PKCE code challenge method. - ::OIDOAuthorizationRequestCodeChallengeMethodS256 when - @c OIDAuthorizationRequest.codeChallengeS256ForVerifier: is used to create the code - challenge. - @param additionalParameters The client's additional authorization parameters. - */ -- (instancetype) - initWithConfiguration:(OIDServiceConfiguration *)configuration - clientId:(NSString *)clientID - clientSecret:(nullable NSString *)clientSecret - scope:(nullable NSString *)scope - redirectURL:(nullable NSURL *)redirectURL - responseType:(NSString *)responseType - state:(nullable NSString *)state - codeVerifier:(nullable NSString *)codeVerifier - codeChallenge:(nullable NSString *)codeChallenge - codeChallengeMethod:(nullable NSString *)codeChallengeMethod - additionalParameters:(nullable NSDictionary *)additionalParameters -__deprecated_msg("Replaced with OIDAuthState.initWithConfiguration:clientId:clientSecret:scope:redirectURL:responseType:state:nonce:codeVerifier:codeChallenge:codeChallengeMethod:additionalParameters:"); - /*! @brief Designated initializer. @param configuration The service's configuration. @param clientID The client identifier. @@ -232,7 +201,9 @@ __deprecated_msg("Replaced with OIDAuthState.initWithConfiguration:clientId:clie @param responseType The expected response type. @param state An opaque value used by the client to maintain state between the request and callback. - @param nonce String value used to associate a Client session with an ID Token. + @param nonce String value used to associate a Client session with an ID Token. Can be set to nil + if not using OpenID Connect, although pure OAuth servers should ignore params they don't + understand anyway. @param codeVerifier The PKCE code verifier. See @c OIDAuthorizationRequest.generateCodeVerifier. @param codeChallenge The PKCE code challenge, calculated from the code verifier such as with @c OIDAuthorizationRequest.codeChallengeS256ForVerifier:. diff --git a/Source/OIDAuthorizationRequest.m b/Source/OIDAuthorizationRequest.m index 7f6c8caf6..0ffc7b586 100644 --- a/Source/OIDAuthorizationRequest.m +++ b/Source/OIDAuthorizationRequest.m @@ -159,32 +159,6 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration return self; } -// Deprecated -- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration - clientId:(NSString *)clientID - clientSecret:(nullable NSString *)clientSecret - scope:(nullable NSString *)scope - redirectURL:(NSURL *)redirectURL - responseType:(NSString *)responseType - state:(nullable NSString *)state - codeVerifier:(nullable NSString *)codeVerifier - codeChallenge:(nullable NSString *)codeChallenge - codeChallengeMethod:(nullable NSString *)codeChallengeMethod - additionalParameters:(nullable NSDictionary *)additionalParameters { - return [self initWithConfiguration:configuration - clientId:clientID - clientSecret:clientSecret - scope:scope - redirectURL:redirectURL - responseType:responseType - state:state - nonce:nil - codeVerifier:codeVerifier - codeChallenge:codeChallenge - codeChallengeMethod:OIDOAuthorizationRequestCodeChallengeMethodS256 - additionalParameters:additionalParameters]; -} - - (instancetype) initWithConfiguration:(OIDServiceConfiguration *)configuration clientId:(NSString *)clientID diff --git a/Source/OIDAuthorizationService.h b/Source/OIDAuthorizationService.h index c61bbc880..64243a4a3 100644 --- a/Source/OIDAuthorizationService.h +++ b/Source/OIDAuthorizationService.h @@ -26,7 +26,6 @@ @class OIDServiceConfiguration; @class OIDTokenRequest; @class OIDTokenResponse; -@protocol OIDAuthorizationFlowSession; @protocol OIDExternalUserAgent; @protocol OIDExternalUserAgentSession; @@ -111,9 +110,6 @@ typedef void (^OIDRegistrationCompletion)(OIDRegistrationResponse *_Nullable reg + (void)discoverServiceConfigurationForDiscoveryURL:(NSURL *)discoveryURL completion:(OIDDiscoveryCallback)completion; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - /*! @brief Perform an authorization flow using a generic flow shim. @param request The authorization request. @param externalUserAgent Generic external user-agent that can present an authorization @@ -123,12 +119,9 @@ typedef void (^OIDRegistrationCompletion)(OIDRegistrationResponse *_Nullable reg receives a @c OIDExternalUserAgentSession.cancel message, or after processing a @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) - presentAuthorizationRequest:(OIDAuthorizationRequest *)request - externalUserAgent:(id)externalUserAgent - callback:(OIDAuthorizationCallback)callback; - -#pragma GCC diagnostic pop ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request + externalUserAgent:(id)externalUserAgent + callback:(OIDAuthorizationCallback)callback; /*! @brief Performs a token request. @param request The token request. diff --git a/Source/OIDAuthorizationService.m b/Source/OIDAuthorizationService.m index 7381a90bc..0aa2f4fe2 100644 --- a/Source/OIDAuthorizationService.m +++ b/Source/OIDAuthorizationService.m @@ -22,7 +22,6 @@ #import "OIDAuthorizationResponse.h" #import "OIDDefines.h" #import "OIDErrorUtilities.h" -#import "OIDAuthorizationFlowSession.h" #import "OIDExternalUserAgent.h" #import "OIDExternalUserAgentSession.h" #import "OIDIDToken.h" @@ -43,18 +42,13 @@ NS_ASSUME_NONNULL_BEGIN -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - -@interface OIDAuthorizationFlowSessionImplementation : NSObject { +@interface OIDAuthorizationSession : NSObject { // private variables OIDAuthorizationRequest *_request; id _externalUserAgent; OIDAuthorizationCallback _pendingauthorizationFlowCallback; } -#pragma GCC diagnostic pop - - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithRequest:(OIDAuthorizationRequest *)request @@ -62,7 +56,7 @@ - (instancetype)initWithRequest:(OIDAuthorizationRequest *)request @end -@implementation OIDAuthorizationFlowSessionImplementation +@implementation OIDAuthorizationSession - (instancetype)initWithRequest:(OIDAuthorizationRequest *)request { self = [super init]; @@ -179,14 +173,6 @@ - (void)didFinishWithResponse:(nullable OIDAuthorizationResponse *)response } } -- (void)failAuthorizationFlowWithError:(NSError *)error { - [self failExternalUserAgentFlowWithError:error]; -} - -- (BOOL)resumeAuthorizationFlowWithURL:(NSURL *)URL { - return [self resumeExternalUserAgentFlowWithURL:URL]; -} - @end @implementation OIDAuthorizationService @@ -274,24 +260,17 @@ + (void)discoverServiceConfigurationForDiscoveryURL:(NSURL *)discoveryURL #pragma mark - Authorization Endpoint -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - -+ (id) - presentAuthorizationRequest:(OIDAuthorizationRequest *)request - externalUserAgent:(id)externalUserAgent - callback:(OIDAuthorizationCallback)callback { ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request + externalUserAgent:(id)externalUserAgent + callback:(OIDAuthorizationCallback)callback { AppAuthRequestTrace(@"Authorization Request: %@", request); - OIDAuthorizationFlowSessionImplementation *flowSession = - [[OIDAuthorizationFlowSessionImplementation alloc] initWithRequest:request]; + OIDAuthorizationSession *flowSession = [[OIDAuthorizationSession alloc] initWithRequest:request]; [flowSession presentAuthorizationWithExternalUserAgent:externalUserAgent callback:callback]; return flowSession; } -#pragma GCC diagnostic pop - #pragma mark - Token Endpoint + (void)performTokenRequest:(OIDTokenRequest *)request callback:(OIDTokenCallback)callback { diff --git a/Source/OIDError.h b/Source/OIDError.h index e48813936..5131f0ad4 100644 --- a/Source/OIDError.h +++ b/Source/OIDError.h @@ -381,7 +381,7 @@ typedef NS_ENUM(NSInteger, OIDErrorCodeOAuthRegistration) { /*! @brief The exception text for the exception which occurs when a - @c OIDAuthorizationFlowSession receives a message after it has already completed. + @c OIDExternalUserAgentSession receives a message after it has already completed. */ extern NSString *const OIDOAuthExceptionInvalidAuthorizationFlow; diff --git a/Source/OIDError.m b/Source/OIDError.m index 2d23d84bf..87c8623ee 100644 --- a/Source/OIDError.m +++ b/Source/OIDError.m @@ -31,7 +31,7 @@ NSString *const OIDHTTPErrorDomain = @"org.openid.appauth.remote-http"; NSString *const OIDOAuthExceptionInvalidAuthorizationFlow = @"An OAuth redirect was sent to a " - "OIDAuthorizationFlowSession after it already completed."; + "OIDExternalUserAgentSession after it already completed."; NSString *const OIDOAuthExceptionInvalidTokenRequestNullRedirectURL = @"A OIDTokenRequest was " "created with a grant_type that requires a redirectURL, but a null redirectURL was given"; diff --git a/Source/iOS/OIDAuthState+IOS.h b/Source/iOS/OIDAuthState+IOS.h index 5b8891c7f..1a3750c5e 100644 --- a/Source/iOS/OIDAuthState+IOS.h +++ b/Source/iOS/OIDAuthState+IOS.h @@ -26,9 +26,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface OIDAuthState (IOS) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - /*! @brief Convenience method to create a @c OIDAuthState by presenting an authorization request and performing the authorization code exchange in the case of code flow requests. @param authorizationRequest The authorization request to present. @@ -39,13 +36,11 @@ NS_ASSUME_NONNULL_BEGIN receives a @c OIDExternalUserAgentSession.cancel message, or after processing a @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest presentingViewController:(UIViewController *)presentingViewController callback:(OIDAuthStateAuthorizationCallback)callback; -#pragma GCC diagnostic pop - @end NS_ASSUME_NONNULL_END diff --git a/Source/iOS/OIDAuthState+IOS.m b/Source/iOS/OIDAuthState+IOS.m index 37f614021..5e7b1fee8 100644 --- a/Source/iOS/OIDAuthState+IOS.m +++ b/Source/iOS/OIDAuthState+IOS.m @@ -22,7 +22,7 @@ @implementation OIDAuthState (IOS) -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest presentingViewController:(UIViewController *)presentingViewController callback:(OIDAuthStateAuthorizationCallback)callback { diff --git a/Source/iOS/OIDAuthorizationService+IOS.h b/Source/iOS/OIDAuthorizationService+IOS.h index b41729054..5cdc6cfe4 100644 --- a/Source/iOS/OIDAuthorizationService+IOS.h +++ b/Source/iOS/OIDAuthorizationService+IOS.h @@ -27,9 +27,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface OIDAuthorizationService (IOS) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - /*! @brief Perform an authorization flow using \SFSafariViewController. @param request The authorization request. @param presentingViewController The view controller from which to present the @@ -39,12 +36,9 @@ NS_ASSUME_NONNULL_BEGIN receives a @c OIDExternalUserAgentSession.cancel message, or after processing a @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) - presentAuthorizationRequest:(OIDAuthorizationRequest *)request - presentingViewController:(UIViewController *)presentingViewController - callback:(OIDAuthorizationCallback)callback; ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request + presentingViewController:(UIViewController *)presentingViewController + callback:(OIDAuthorizationCallback)callback; @end -#pragma GCC diagnostic pop - NS_ASSUME_NONNULL_END diff --git a/Source/iOS/OIDAuthorizationService+IOS.m b/Source/iOS/OIDAuthorizationService+IOS.m index 131f60f92..7364f7f13 100644 --- a/Source/iOS/OIDAuthorizationService+IOS.m +++ b/Source/iOS/OIDAuthorizationService+IOS.m @@ -24,10 +24,9 @@ @implementation OIDAuthorizationService (IOS) -+ (id) - presentAuthorizationRequest:(OIDAuthorizationRequest *)request - presentingViewController:(UIViewController *)presentingViewController - callback:(OIDAuthorizationCallback)callback { ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request + presentingViewController:(UIViewController *)presentingViewController + callback:(OIDAuthorizationCallback)callback { OIDExternalUserAgentIOS *externalUserAgent = [[OIDExternalUserAgentIOS alloc] initWithPresentingViewController:presentingViewController]; return [self presentAuthorizationRequest:request externalUserAgent:externalUserAgent callback:callback]; diff --git a/Source/macOS/OIDAuthState+Mac.h b/Source/macOS/OIDAuthState+Mac.h index 4e94f1f20..6f1824f33 100644 --- a/Source/macOS/OIDAuthState+Mac.h +++ b/Source/macOS/OIDAuthState+Mac.h @@ -24,9 +24,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface OIDAuthState (Mac) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - /*! @brief Convenience method to create a @c OIDAuthState by presenting an authorization request and performing the authorization code exchange in the case of code flow requests. @param authorizationRequest The authorization request to present. @@ -35,12 +32,10 @@ NS_ASSUME_NONNULL_BEGIN receives a @c OIDExternalUserAgentSession.cancel message, or after processing a @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest callback:(OIDAuthStateAuthorizationCallback)callback; -#pragma GCC diagnostic pop - @end NS_ASSUME_NONNULL_END diff --git a/Source/macOS/OIDAuthState+Mac.m b/Source/macOS/OIDAuthState+Mac.m index 7b99e734f..ce99a7370 100644 --- a/Source/macOS/OIDAuthState+Mac.m +++ b/Source/macOS/OIDAuthState+Mac.m @@ -22,7 +22,7 @@ @implementation OIDAuthState (Mac) -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest callback:(OIDAuthStateAuthorizationCallback)callback { OIDExternalUserAgentMac *externalUserAgent = [[OIDExternalUserAgentMac alloc] init]; diff --git a/Source/macOS/OIDAuthorizationService+Mac.h b/Source/macOS/OIDAuthorizationService+Mac.h index 95231e0e9..405d25ce7 100644 --- a/Source/macOS/OIDAuthorizationService+Mac.h +++ b/Source/macOS/OIDAuthorizationService+Mac.h @@ -24,9 +24,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface OIDAuthorizationService (Mac) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - /*! @brief Perform an authorization flow using the default browser. @param request The authorization request. @param callback The method called when the request has completed or failed. @@ -34,11 +31,8 @@ NS_ASSUME_NONNULL_BEGIN receives a @c OIDExternalUserAgentSession.cancel message, or after processing a @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) - presentAuthorizationRequest:(OIDAuthorizationRequest *)request - callback:(OIDAuthorizationCallback)callback; - -#pragma GCC diagnostic pop ++ (id)presentAuthorizationRequest:(OIDAuthorizationRequest *)request + callback:(OIDAuthorizationCallback)callback; @end diff --git a/Source/macOS/OIDAuthorizationService+Mac.m b/Source/macOS/OIDAuthorizationService+Mac.m index 4c7892083..781394253 100644 --- a/Source/macOS/OIDAuthorizationService+Mac.m +++ b/Source/macOS/OIDAuthorizationService+Mac.m @@ -24,11 +24,12 @@ @implementation OIDAuthorizationService (Mac) -+ (id) - presentAuthorizationRequest:(OIDAuthorizationRequest *)request - callback:(OIDAuthorizationCallback)callback { ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request + callback:(OIDAuthorizationCallback)callback { OIDExternalUserAgentMac *externalUserAgent = [[OIDExternalUserAgentMac alloc] init]; - return [self presentAuthorizationRequest:request externalUserAgent:externalUserAgent callback:callback]; + return [self presentAuthorizationRequest:request + externalUserAgent:externalUserAgent + callback:callback]; } @end diff --git a/Source/macOS/OIDRedirectHTTPHandler.h b/Source/macOS/OIDRedirectHTTPHandler.h index bd1e977c5..a925dee89 100644 --- a/Source/macOS/OIDRedirectHTTPHandler.h +++ b/Source/macOS/OIDRedirectHTTPHandler.h @@ -21,12 +21,8 @@ NS_ASSUME_NONNULL_BEGIN @class HTTPServer; -@protocol OIDAuthorizationFlowSession; @protocol OIDExternalUserAgentSession; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - /*! @brief Start a HTTP server on the loopback interface (i.e. @c 127.0.0.1) to receive the OAuth response redirects on macOS. */ @@ -35,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN HTTPServer *_httpServ; NSURL *_successURL; // property variables - NSObject *_currentAuthorizationFlow; + NSObject *_currentAuthorizationFlow; } /*! @brief The external user-agent request flow session which receives the return URL from the @@ -44,10 +40,7 @@ NS_ASSUME_NONNULL_BEGIN redirect handler to continue the flow. This should be set while an external user-agent request flow is in progress. */ -@property(nonatomic, strong, nullable) id currentAuthorizationFlow; - -#pragma GCC diagnostic pop +@property(nonatomic, strong, nullable) id currentAuthorizationFlow; /*! @brief Creates an a loopback HTTP redirect URI handler with the given success URL. @param successURL The URL that the user is redirected to after the external user-agent request flow completes diff --git a/Source/macOS/OIDRedirectHTTPHandler.m b/Source/macOS/OIDRedirectHTTPHandler.m index fa19d416a..8c5b21872 100644 --- a/Source/macOS/OIDRedirectHTTPHandler.m +++ b/Source/macOS/OIDRedirectHTTPHandler.m @@ -18,7 +18,6 @@ #import "OIDRedirectHTTPHandler.h" -#import "OIDAuthorizationFlowSession.h" #import "OIDAuthorizationService.h" #import "OIDErrorUtilities.h" #import "OIDExternalUserAgentSession.h" @@ -33,7 +32,7 @@ /*! @brief Error warning that the @c currentAuthorizationFlow is not set on this object (likely a developer error, unless the user stumbled upon the loopback server before the authorization had started completely). - @description An object conforming to @c OIDAuthorizationFlowSession is returned when the + @description An object conforming to @c OIDExternalUserAgentSession is returned when the authorization is presented with @c OIDAuthorizationService::presentAuthorizationRequest:callback:. It should be set to @c currentAuthorization when using a loopback redirect. diff --git a/UnitTests/OIDRPProfileCode.m b/UnitTests/OIDRPProfileCode.m index 1cf4a127d..7011bc563 100644 --- a/UnitTests/OIDRPProfileCode.m +++ b/UnitTests/OIDRPProfileCode.m @@ -81,7 +81,7 @@ - (void)URLSession:(NSURLSession *)session } @end -@interface OIDAuthorizationFlowSessionImplementation : NSObject +@interface OIDAuthorizationSession : NSObject - (instancetype)init NS_UNAVAILABLE;