diff --git a/AppAuth.xcodeproj/project.pbxproj b/AppAuth.xcodeproj/project.pbxproj index 52e5e5bee..0466acaf9 100644 --- a/AppAuth.xcodeproj/project.pbxproj +++ b/AppAuth.xcodeproj/project.pbxproj @@ -10,7 +10,7 @@ 039697461FA8258D003D1FB2 /* OIDURLSessionProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 039697451FA8258D003D1FB2 /* OIDURLSessionProvider.m */; }; 0396974D1FA827AD003D1FB2 /* OIDURLSessionProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0396974C1FA827AD003D1FB2 /* OIDURLSessionProviderTests.m */; }; 340DAE571D5821A100EC285B /* OIDAuthorizationService+Mac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE261D581FE700EC285B /* OIDAuthorizationService+Mac.m */; }; - 340DAE581D5821A100EC285B /* OIDUserAgentUICoordinatorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE281D581FE700EC285B /* OIDUserAgentUICoordinatorMac.m */; }; + 340DAE581D5821A100EC285B /* OIDExternalUserAgentUICoordinatorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE281D581FE700EC285B /* OIDExternalUserAgentUICoordinatorMac.m */; }; 340DAE591D5821A100EC285B /* OIDAuthState+Mac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE2A1D581FE700EC285B /* OIDAuthState+Mac.m */; }; 340DAE5A1D5821AB00EC285B /* OIDAuthorizationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 341741B51C5D8243000EF209 /* OIDAuthorizationRequest.m */; }; 340DAE5C1D5821AB00EC285B /* OIDAuthorizationService.m in Sources */ = {isa = PBXBuildFile; fileRef = 341741B91C5D8243000EF209 /* OIDAuthorizationService.m */; }; @@ -159,11 +159,11 @@ 343AAACB1E8348AA00F9D36E /* AppAuth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 343AAAC21E8348A900F9D36E /* AppAuth.framework */; }; 343AAAD91E83493D00F9D36E /* OIDRedirectHTTPHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAEBA1D582AF100EC285B /* OIDRedirectHTTPHandler.m */; }; 343AAADA1E83493D00F9D36E /* OIDAuthorizationService+Mac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE261D581FE700EC285B /* OIDAuthorizationService+Mac.m */; }; - 343AAADB1E83493D00F9D36E /* OIDUserAgentUICoordinatorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE281D581FE700EC285B /* OIDUserAgentUICoordinatorMac.m */; }; + 343AAADB1E83493D00F9D36E /* OIDExternalUserAgentUICoordinatorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE281D581FE700EC285B /* OIDExternalUserAgentUICoordinatorMac.m */; }; 343AAADC1E83493D00F9D36E /* OIDAuthState+Mac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE2A1D581FE700EC285B /* OIDAuthState+Mac.m */; }; 343AAADD1E83494400F9D36E /* OIDRedirectHTTPHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 340DAEB91D582AF100EC285B /* OIDRedirectHTTPHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAADE1E83494400F9D36E /* OIDAuthorizationService+Mac.h in Headers */ = {isa = PBXBuildFile; fileRef = 340DAE251D581FE700EC285B /* OIDAuthorizationService+Mac.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 343AAADF1E83494400F9D36E /* OIDUserAgentUICoordinatorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 340DAE271D581FE700EC285B /* OIDUserAgentUICoordinatorMac.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 343AAADF1E83494400F9D36E /* OIDExternalUserAgentUICoordinatorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 340DAE271D581FE700EC285B /* OIDExternalUserAgentUICoordinatorMac.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAE01E83494400F9D36E /* OIDAuthState+Mac.h in Headers */ = {isa = PBXBuildFile; fileRef = 340DAE291D581FE700EC285B /* OIDAuthState+Mac.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAE11E83494A00F9D36E /* OIDLoopbackHTTPServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 34FEA6AC1DB6E083005C9212 /* OIDLoopbackHTTPServer.h */; }; 343AAAE21E83494F00F9D36E /* OIDLoopbackHTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 34FEA6AD1DB6E083005C9212 /* OIDLoopbackHTTPServer.m */; }; @@ -370,21 +370,21 @@ 60140F801DE4344200DA0DC3 /* OIDRegistrationResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 60140F7F1DE4344200DA0DC3 /* OIDRegistrationResponse.m */; }; 60140F831DE43BAF00DA0DC3 /* OIDRegistrationRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 60140F821DE43BAF00DA0DC3 /* OIDRegistrationRequestTests.m */; }; 60140F861DE43CC700DA0DC3 /* OIDRegistrationResponseTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 60140F851DE43CC700DA0DC3 /* OIDRegistrationResponseTests.m */; }; - A6DEAB9B2018E4AD0022AC32 /* OIDUserAgentUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDUserAgentUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEAB9C2018E4AD0022AC32 /* OIDUserAgentUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDUserAgentUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEAB9D2018E4AD0022AC32 /* OIDUserAgentUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDUserAgentUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEAB9E2018E4AE0022AC32 /* OIDUserAgentUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDUserAgentUICoordinator.h */; }; - A6DEAB9F2018E4B00022AC32 /* OIDUserAgentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB9A2018E4A20022AC32 /* OIDUserAgentRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEABA02018E4B00022AC32 /* OIDUserAgentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB9A2018E4A20022AC32 /* OIDUserAgentRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEABA22018E4B60022AC32 /* OIDUserAgentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB9A2018E4A20022AC32 /* OIDUserAgentRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEABA32018E4B70022AC32 /* OIDUserAgentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB9A2018E4A20022AC32 /* OIDUserAgentRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEABA42018E4B90022AC32 /* OIDUserAgentFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB992018E4A20022AC32 /* OIDUserAgentFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEABA52018E4BA0022AC32 /* OIDUserAgentFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB992018E4A20022AC32 /* OIDUserAgentFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEABA62018E4BA0022AC32 /* OIDUserAgentFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB992018E4A20022AC32 /* OIDUserAgentFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEABA72018E4BA0022AC32 /* OIDUserAgentFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB992018E4A20022AC32 /* OIDUserAgentFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEABAA2018E5B50022AC32 /* OIDUserAgentUICoordinatorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = A6DEABA82018E5B50022AC32 /* OIDUserAgentUICoordinatorIOS.m */; }; - A6DEABAB2018E5C50022AC32 /* OIDUserAgentUICoordinatorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEABA92018E5B50022AC32 /* OIDUserAgentUICoordinatorIOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A6DEABAF2018E5D80022AC32 /* OIDUserAgentUICoordinatorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = A6DEABA82018E5B50022AC32 /* OIDUserAgentUICoordinatorIOS.m */; }; + A6DEAB9B2018E4AD0022AC32 /* OIDExternalUserAgentUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgentUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEAB9C2018E4AD0022AC32 /* OIDExternalUserAgentUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgentUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEAB9D2018E4AD0022AC32 /* OIDExternalUserAgentUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgentUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEAB9E2018E4AE0022AC32 /* OIDExternalUserAgentUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgentUICoordinator.h */; }; + A6DEAB9F2018E4B00022AC32 /* OIDExternalUserAgentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEABA02018E4B00022AC32 /* OIDExternalUserAgentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEABA22018E4B60022AC32 /* OIDExternalUserAgentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEABA32018E4B70022AC32 /* OIDExternalUserAgentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEABA42018E4B90022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEABA52018E4BA0022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEABA62018E4BA0022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEABA72018E4BA0022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEABAA2018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = A6DEABA82018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m */; }; + A6DEABAB2018E5C50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEABA92018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEABAF2018E5D80022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = A6DEABA82018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -468,8 +468,8 @@ 0396974C1FA827AD003D1FB2 /* OIDURLSessionProviderTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OIDURLSessionProviderTests.m; sourceTree = ""; }; 340DAE251D581FE700EC285B /* OIDAuthorizationService+Mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OIDAuthorizationService+Mac.h"; sourceTree = ""; }; 340DAE261D581FE700EC285B /* OIDAuthorizationService+Mac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OIDAuthorizationService+Mac.m"; sourceTree = ""; }; - 340DAE271D581FE700EC285B /* OIDUserAgentUICoordinatorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDUserAgentUICoordinatorMac.h; sourceTree = ""; }; - 340DAE281D581FE700EC285B /* OIDUserAgentUICoordinatorMac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OIDUserAgentUICoordinatorMac.m; sourceTree = ""; }; + 340DAE271D581FE700EC285B /* OIDExternalUserAgentUICoordinatorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgentUICoordinatorMac.h; sourceTree = ""; }; + 340DAE281D581FE700EC285B /* OIDExternalUserAgentUICoordinatorMac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OIDExternalUserAgentUICoordinatorMac.m; sourceTree = ""; }; 340DAE291D581FE700EC285B /* OIDAuthState+Mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OIDAuthState+Mac.h"; sourceTree = ""; }; 340DAE2A1D581FE700EC285B /* OIDAuthState+Mac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OIDAuthState+Mac.m"; sourceTree = ""; }; 340DAE4E1D58216A00EC285B /* libAppAuth-macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libAppAuth-macOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -565,11 +565,11 @@ 60140F821DE43BAF00DA0DC3 /* OIDRegistrationRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OIDRegistrationRequestTests.m; sourceTree = ""; }; 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 = ""; }; - A6DEAB982018E4A20022AC32 /* OIDUserAgentUICoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDUserAgentUICoordinator.h; sourceTree = ""; }; - A6DEAB992018E4A20022AC32 /* OIDUserAgentFlowSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDUserAgentFlowSession.h; sourceTree = ""; }; - A6DEAB9A2018E4A20022AC32 /* OIDUserAgentRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDUserAgentRequest.h; sourceTree = ""; }; - A6DEABA82018E5B50022AC32 /* OIDUserAgentUICoordinatorIOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OIDUserAgentUICoordinatorIOS.m; path = iOS/OIDUserAgentUICoordinatorIOS.m; sourceTree = ""; }; - A6DEABA92018E5B50022AC32 /* OIDUserAgentUICoordinatorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OIDUserAgentUICoordinatorIOS.h; path = iOS/OIDUserAgentUICoordinatorIOS.h; sourceTree = ""; }; + A6DEAB982018E4A20022AC32 /* OIDExternalUserAgentUICoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgentUICoordinator.h; sourceTree = ""; }; + A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentFlowSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgentFlowSession.h; sourceTree = ""; }; + A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgentRequest.h; sourceTree = ""; }; + A6DEABA82018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OIDExternalUserAgentUICoordinatorIOS.m; path = iOS/OIDExternalUserAgentUICoordinatorIOS.m; sourceTree = ""; }; + A6DEABA92018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OIDExternalUserAgentUICoordinatorIOS.h; path = iOS/OIDExternalUserAgentUICoordinatorIOS.h; sourceTree = ""; }; F6F60FB01D2BFEFE00325CB3 /* OIDAuthState+IOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OIDAuthState+IOS.m"; path = "iOS/OIDAuthState+IOS.m"; sourceTree = ""; }; F6F60FB11D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OIDAuthorizationService+IOS.m"; path = "iOS/OIDAuthorizationService+IOS.m"; sourceTree = ""; }; F6F60FB31D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OIDAuthorizationService+IOS.h"; path = "iOS/OIDAuthorizationService+IOS.h"; sourceTree = ""; }; @@ -694,8 +694,8 @@ 340DAEBA1D582AF100EC285B /* OIDRedirectHTTPHandler.m */, 340DAE251D581FE700EC285B /* OIDAuthorizationService+Mac.h */, 340DAE261D581FE700EC285B /* OIDAuthorizationService+Mac.m */, - 340DAE271D581FE700EC285B /* OIDUserAgentUICoordinatorMac.h */, - 340DAE281D581FE700EC285B /* OIDUserAgentUICoordinatorMac.m */, + 340DAE271D581FE700EC285B /* OIDExternalUserAgentUICoordinatorMac.h */, + 340DAE281D581FE700EC285B /* OIDExternalUserAgentUICoordinatorMac.m */, 340DAE291D581FE700EC285B /* OIDAuthState+Mac.h */, 340DAE2A1D581FE700EC285B /* OIDAuthState+Mac.m */, ); @@ -748,9 +748,9 @@ 341741B91C5D8243000EF209 /* OIDAuthorizationService.m */, 341741BA1C5D8243000EF209 /* OIDAuthState.h */, 341741BB1C5D8243000EF209 /* OIDAuthState.m */, - A6DEAB992018E4A20022AC32 /* OIDUserAgentFlowSession.h */, - A6DEAB9A2018E4A20022AC32 /* OIDUserAgentRequest.h */, - A6DEAB982018E4A20022AC32 /* OIDUserAgentUICoordinator.h */, + A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentFlowSession.h */, + A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */, + A6DEAB982018E4A20022AC32 /* OIDExternalUserAgentUICoordinator.h */, 341741BC1C5D8243000EF209 /* OIDAuthStateChangeDelegate.h */, 341741BD1C5D8243000EF209 /* OIDAuthStateErrorDelegate.h */, 60140F781DE4262000DA0DC3 /* OIDClientMetadataParameters.h */, @@ -861,8 +861,8 @@ F6F60FB11D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.m */, F6F60FB51D2BFEFE00325CB3 /* OIDAuthState+IOS.h */, F6F60FB01D2BFEFE00325CB3 /* OIDAuthState+IOS.m */, - A6DEABA92018E5B50022AC32 /* OIDUserAgentUICoordinatorIOS.h */, - A6DEABA82018E5B50022AC32 /* OIDUserAgentUICoordinatorIOS.m */, + A6DEABA92018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.h */, + A6DEABA82018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m */, ); name = iOS; sourceTree = ""; @@ -885,7 +885,7 @@ files = ( 343AAAE41E83499000F9D36E /* OIDAuthorizationResponse.h in Headers */, 343AAAF31E83499000F9D36E /* OIDScopes.h in Headers */, - A6DEAB9F2018E4B00022AC32 /* OIDUserAgentRequest.h in Headers */, + A6DEAB9F2018E4B00022AC32 /* OIDExternalUserAgentRequest.h in Headers */, 343AAAE81E83499000F9D36E /* OIDAuthStateChangeDelegate.h in Headers */, 343AAA6B1E83465500F9D36E /* AppAuth.h in Headers */, 343AAAF21E83499000F9D36E /* OIDResponseTypes.h in Headers */, @@ -896,8 +896,8 @@ 343AAAF11E83499000F9D36E /* OIDGrantTypes.h in Headers */, 343AAA6D1E83466B00F9D36E /* OIDAuthState+IOS.h in Headers */, 343AAAEF1E83499000F9D36E /* OIDRegistrationResponse.h in Headers */, - A6DEAB9B2018E4AD0022AC32 /* OIDUserAgentUICoordinator.h in Headers */, - A6DEABA42018E4B90022AC32 /* OIDUserAgentFlowSession.h in Headers */, + A6DEAB9B2018E4AD0022AC32 /* OIDExternalUserAgentUICoordinator.h in Headers */, + A6DEABA42018E4B90022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */, 343AAAF51E83499000F9D36E /* OIDServiceConfiguration.h in Headers */, 343AAAE91E83499000F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, 343AAAE51E83499000F9D36E /* OIDAuthorizationService.h in Headers */, @@ -908,7 +908,7 @@ 343AAAE31E83499000F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAAF91E83499000F9D36E /* OIDTokenUtilities.h in Headers */, 343AAAEC1E83499000F9D36E /* OIDError.h in Headers */, - A6DEABAB2018E5C50022AC32 /* OIDUserAgentUICoordinatorIOS.h in Headers */, + A6DEABAB2018E5C50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -919,16 +919,16 @@ 343AAB041E83499100F9D36E /* OIDError.h in Headers */, 343AAB091E83499100F9D36E /* OIDGrantTypes.h in Headers */, 343AAAFF1E83499100F9D36E /* OIDAuthState.h in Headers */, - A6DEABA52018E4BA0022AC32 /* OIDUserAgentFlowSession.h in Headers */, + A6DEABA52018E4BA0022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */, 343AAB0D1E83499100F9D36E /* OIDServiceConfiguration.h in Headers */, - A6DEABA02018E4B00022AC32 /* OIDUserAgentRequest.h in Headers */, + A6DEABA02018E4B00022AC32 /* OIDExternalUserAgentRequest.h in Headers */, 343AAAFD1E83499100F9D36E /* OIDAuthorizationService.h in Headers */, 343AAB0F1E83499100F9D36E /* OIDTokenRequest.h in Headers */, 343AAB071E83499100F9D36E /* OIDRegistrationResponse.h in Headers */, 343AAB0E1E83499100F9D36E /* OIDServiceDiscovery.h in Headers */, 343AAB111E83499100F9D36E /* OIDTokenUtilities.h in Headers */, 343AAB0A1E83499100F9D36E /* OIDResponseTypes.h in Headers */, - A6DEAB9C2018E4AD0022AC32 /* OIDUserAgentUICoordinator.h in Headers */, + A6DEAB9C2018E4AD0022AC32 /* OIDExternalUserAgentUICoordinator.h in Headers */, 343AAB0B1E83499100F9D36E /* OIDScopes.h in Headers */, 343AAB9B1E834A8800F9D36E /* AppAuth.h in Headers */, 343AAB001E83499100F9D36E /* OIDAuthStateChangeDelegate.h in Headers */, @@ -949,16 +949,16 @@ 343AAB1C1E83499200F9D36E /* OIDError.h in Headers */, 343AAB211E83499200F9D36E /* OIDGrantTypes.h in Headers */, 343AAB171E83499200F9D36E /* OIDAuthState.h in Headers */, - A6DEABA62018E4BA0022AC32 /* OIDUserAgentFlowSession.h in Headers */, + A6DEABA62018E4BA0022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */, 343AAB251E83499200F9D36E /* OIDServiceConfiguration.h in Headers */, - A6DEABA22018E4B60022AC32 /* OIDUserAgentRequest.h in Headers */, + A6DEABA22018E4B60022AC32 /* OIDExternalUserAgentRequest.h in Headers */, 343AAB151E83499200F9D36E /* OIDAuthorizationService.h in Headers */, 343AAB271E83499200F9D36E /* OIDTokenRequest.h in Headers */, 343AAB1F1E83499200F9D36E /* OIDRegistrationResponse.h in Headers */, 343AAB261E83499200F9D36E /* OIDServiceDiscovery.h in Headers */, 343AAB291E83499200F9D36E /* OIDTokenUtilities.h in Headers */, 343AAB221E83499200F9D36E /* OIDResponseTypes.h in Headers */, - A6DEAB9D2018E4AD0022AC32 /* OIDUserAgentUICoordinator.h in Headers */, + A6DEAB9D2018E4AD0022AC32 /* OIDExternalUserAgentUICoordinator.h in Headers */, 343AAB231E83499200F9D36E /* OIDScopes.h in Headers */, 343AAB9C1E834A8900F9D36E /* AppAuth.h in Headers */, 343AAB181E83499200F9D36E /* OIDAuthStateChangeDelegate.h in Headers */, @@ -977,14 +977,14 @@ buildActionMask = 2147483647; files = ( 343AAB9D1E834A8A00F9D36E /* AppAuth.h in Headers */, - A6DEABA72018E4BA0022AC32 /* OIDUserAgentFlowSession.h in Headers */, - 343AAADF1E83494400F9D36E /* OIDUserAgentUICoordinatorMac.h in Headers */, + A6DEABA72018E4BA0022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */, + 343AAADF1E83494400F9D36E /* OIDExternalUserAgentUICoordinatorMac.h in Headers */, 343AAAE01E83494400F9D36E /* OIDAuthState+Mac.h in Headers */, 343AAADD1E83494400F9D36E /* OIDRedirectHTTPHandler.h in Headers */, 343AAB3C1E83499200F9D36E /* OIDScopeUtilities.h in Headers */, 343AAB3F1E83499200F9D36E /* OIDTokenRequest.h in Headers */, 343AAB411E83499200F9D36E /* OIDTokenUtilities.h in Headers */, - A6DEABA32018E4B70022AC32 /* OIDUserAgentRequest.h in Headers */, + A6DEABA32018E4B70022AC32 /* OIDExternalUserAgentRequest.h in Headers */, 343AAB371E83499200F9D36E /* OIDRegistrationResponse.h in Headers */, 343AAB2B1E83499200F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAB3B1E83499200F9D36E /* OIDScopes.h in Headers */, @@ -999,7 +999,7 @@ 343AAB311E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, 343AAB2F1E83499200F9D36E /* OIDAuthState.h in Headers */, 343AAB3E1E83499200F9D36E /* OIDServiceDiscovery.h in Headers */, - A6DEAB9E2018E4AE0022AC32 /* OIDUserAgentUICoordinator.h in Headers */, + A6DEAB9E2018E4AE0022AC32 /* OIDExternalUserAgentUICoordinator.h in Headers */, 343AAADE1E83494400F9D36E /* OIDAuthorizationService+Mac.h in Headers */, 343AAB301E83499200F9D36E /* OIDAuthStateChangeDelegate.h in Headers */, 343AAB381E83499200F9D36E /* OIDRegistrationRequest.h in Headers */, @@ -1449,7 +1449,7 @@ 341310C91E6F944B00D5DEE5 /* OIDScopes.m in Sources */, 341310CE1E6F944B00D5DEE5 /* OIDTokenResponse.m in Sources */, 341310C31E6F944B00D5DEE5 /* OIDErrorUtilities.m in Sources */, - 340DAE581D5821A100EC285B /* OIDUserAgentUICoordinatorMac.m in Sources */, + 340DAE581D5821A100EC285B /* OIDExternalUserAgentUICoordinatorMac.m in Sources */, 340DAE5A1D5821AB00EC285B /* OIDAuthorizationRequest.m in Sources */, 347423E41E7F3C4000D3E6D6 /* OIDAuthorizationResponse.m in Sources */, 340DAE591D5821A100EC285B /* OIDAuthState+Mac.m in Sources */, @@ -1464,7 +1464,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - A6DEABAA2018E5B50022AC32 /* OIDUserAgentUICoordinatorIOS.m in Sources */, + A6DEABAA2018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m in Sources */, 341741E01C5D8243000EF209 /* OIDErrorUtilities.m in Sources */, 341741EA1C5D8243000EF209 /* OIDTokenUtilities.m in Sources */, 341741E21C5D8243000EF209 /* OIDGrantTypes.m in Sources */, @@ -1586,7 +1586,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - A6DEABAF2018E5D80022AC32 /* OIDUserAgentUICoordinatorIOS.m in Sources */, + A6DEABAF2018E5D80022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m in Sources */, 343AAA881E83478900F9D36E /* OIDFieldMapping.m in Sources */, 343AAA841E83478900F9D36E /* OIDAuthState.m in Sources */, 343AAA701E83467D00F9D36E /* OIDAuthState+IOS.m in Sources */, @@ -1734,7 +1734,7 @@ 343AAB4F1E8349AF00F9D36E /* OIDScopes.m in Sources */, 343AAB541E8349AF00F9D36E /* OIDTokenResponse.m in Sources */, 343AAB491E8349AF00F9D36E /* OIDErrorUtilities.m in Sources */, - 343AAADB1E83493D00F9D36E /* OIDUserAgentUICoordinatorMac.m in Sources */, + 343AAADB1E83493D00F9D36E /* OIDExternalUserAgentUICoordinatorMac.m in Sources */, 343AAB471E8349AF00F9D36E /* OIDClientMetadataParameters.m in Sources */, 343AAB461E8349AF00F9D36E /* OIDAuthState.m in Sources */, 34AF736D1FB4E4B40022335F /* OIDURLSessionProvider.m in Sources */, diff --git a/Source/AppAuth.h b/Source/AppAuth.h index 33ed7ca47..6aeba16d4 100644 --- a/Source/AppAuth.h +++ b/Source/AppAuth.h @@ -22,7 +22,7 @@ #import "OIDAuthorizationRequest.h" #import "OIDAuthorizationResponse.h" #import "OIDAuthorizationService.h" -#import "OIDUserAgentUICoordinator.h" +#import "OIDExternalUserAgentUICoordinator.h" #import "OIDError.h" #import "OIDErrorUtilities.h" #import "OIDGrantTypes.h" @@ -43,11 +43,11 @@ #elif TARGET_OS_IOS #import "OIDAuthState+IOS.h" #import "OIDAuthorizationService+IOS.h" -#import "OIDUserAgentUICoordinatorIOS.h" +#import "OIDExternalUserAgentUICoordinatorIOS.h" #elif TARGET_OS_MAC #import "OIDAuthState+Mac.h" #import "OIDAuthorizationService+Mac.h" -#import "OIDUserAgentUICoordinatorMac.h" +#import "OIDExternalUserAgentUICoordinatorMac.h" #import "OIDRedirectHTTPHandler.h" #else #error "Platform Undefined" diff --git a/Source/Framework/AppAuth.h b/Source/Framework/AppAuth.h index 6e814b44d..49ab0bea8 100644 --- a/Source/Framework/AppAuth.h +++ b/Source/Framework/AppAuth.h @@ -30,7 +30,7 @@ FOUNDATION_EXPORT const unsigned char AppAuthVersionString[]; #import #import #import -#import +#import #import #import #import @@ -50,11 +50,11 @@ FOUNDATION_EXPORT const unsigned char AppAuthVersionString[]; #elif TARGET_OS_IOS #import #import -#import +#import #elif TARGET_OS_MAC #import #import -#import +#import #import #else #error "Platform Undefined" diff --git a/Source/OIDAuthState.h b/Source/OIDAuthState.h index 63de8148c..fbd3ac206 100644 --- a/Source/OIDAuthState.h +++ b/Source/OIDAuthState.h @@ -25,8 +25,8 @@ @class OIDTokenRequest; @protocol OIDAuthStateChangeDelegate; @protocol OIDAuthStateErrorDelegate; -@protocol OIDUserAgentUICoordinator; -@protocol OIDUserAgentFlowSession; +@protocol OIDExternalUserAgentUICoordinator; +@protocol OIDExternalUserAgentFlowSession; NS_ASSUME_NONNULL_BEGIN @@ -142,15 +142,15 @@ typedef void (^OIDAuthStateAuthorizationCallback)(OIDAuthState *_Nullable authSt /*! @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. - @param UICoordinator Generic UI coordinator that can present an user-agent request. + @param UICoordinator Generic UI coordinator that can present an external user-agent request. @param callback The method called when the request has completed or failed. - @return A @c OIDUserAgentFlowSession instance which will terminate when it - receives a @c OIDUserAgentFlowSession.cancel message, or after processing a - @c OIDUserAgentFlowSession.resumeUserAgentFlowWithURL: message. + @return A @c OIDExternalUserAgentFlowSession instance which will terminate when it + receives a @c OIDExternalUserAgentFlowSession.cancel message, or after processing a + @c OIDExternalUserAgentFlowSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest - UICoordinator:(id)UICoordinator + UICoordinator:(id)UICoordinator callback:(OIDAuthStateAuthorizationCallback)callback; /*! @internal diff --git a/Source/OIDAuthState.m b/Source/OIDAuthState.m index ce4dbef5d..b4162c79a 100644 --- a/Source/OIDAuthState.m +++ b/Source/OIDAuthState.m @@ -104,12 +104,12 @@ @implementation OIDAuthState #pragma mark - Convenience initializers -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest - UICoordinator:(id)UICoordinator + UICoordinator:(id)UICoordinator callback:(OIDAuthStateAuthorizationCallback)callback { // presents the authorization request - id authFlowSession = [OIDAuthorizationService + id authFlowSession = [OIDAuthorizationService presentAuthorizationRequest:authorizationRequest UICoordinator:UICoordinator callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse, diff --git a/Source/OIDAuthorizationRequest.h b/Source/OIDAuthorizationRequest.h index 57cd20053..2df78f4bd 100644 --- a/Source/OIDAuthorizationRequest.h +++ b/Source/OIDAuthorizationRequest.h @@ -22,7 +22,7 @@ // so they are imported here for convenience. #import "OIDResponseTypes.h" #import "OIDScopes.h" -#import "OIDUserAgentRequest.h" +#import "OIDExternalUserAgentRequest.h" @class OIDServiceConfiguration; @@ -38,7 +38,7 @@ extern NSString *const OIDOAuthorizationRequestCodeChallengeMethodS256; @see https://tools.ietf.org/html/rfc6749#section-4 @see https://tools.ietf.org/html/rfc6749#section-4.1.1 */ -@interface OIDAuthorizationRequest : NSObject { +@interface OIDAuthorizationRequest : NSObject { // property variables OIDServiceConfiguration *_configuration; NSString *_responseType; diff --git a/Source/OIDAuthorizationRequest.m b/Source/OIDAuthorizationRequest.m index 503b702f7..73052b09d 100644 --- a/Source/OIDAuthorizationRequest.m +++ b/Source/OIDAuthorizationRequest.m @@ -329,9 +329,9 @@ - (NSURL *)authorizationRequestURL { return [query URLByReplacingQueryInURL:_configuration.authorizationEndpoint]; } -#pragma mark - OIDUserAgentRequest +#pragma mark - OIDExternalUserAgentRequest -- (NSURL *)userAgentRequestURL { +- (NSURL *)externalUserAgentRequestURL { return [self authorizationRequestURL]; } diff --git a/Source/OIDAuthorizationService.h b/Source/OIDAuthorizationService.h index 65746ab93..bd1554c6f 100644 --- a/Source/OIDAuthorizationService.h +++ b/Source/OIDAuthorizationService.h @@ -26,8 +26,8 @@ @class OIDServiceConfiguration; @class OIDTokenRequest; @class OIDTokenResponse; -@protocol OIDUserAgentFlowSession; -@protocol OIDUserAgentUICoordinator; +@protocol OIDExternalUserAgentFlowSession; +@protocol OIDExternalUserAgentUICoordinator; NS_ASSUME_NONNULL_BEGIN @@ -115,13 +115,13 @@ typedef void (^OIDRegistrationCompletion)(OIDRegistrationResponse *_Nullable reg @param UICoordinator Generic authorization UI coordinator that can present an authorization request. @param callback The method called when the request has completed or failed. - @return A @c OIDUserAgentFlowSession instance which will terminate when it - receives a @c OIDUserAgentFlowSession.cancel message, or after processing a - @c OIDUserAgentFlowSession.resumeUserAgentFlowWithURL: message. + @return A @c OIDExternalUserAgentFlowSession instance which will terminate when it + receives a @c OIDExternalUserAgentFlowSession.cancel message, or after processing a + @c OIDExternalUserAgentFlowSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request - UICoordinator:(id)UICoordinator + UICoordinator:(id)UICoordinator callback:(OIDAuthorizationCallback)callback; /*! @brief Performs a token request. diff --git a/Source/OIDAuthorizationService.m b/Source/OIDAuthorizationService.m index b8a11cb89..ea342d23b 100644 --- a/Source/OIDAuthorizationService.m +++ b/Source/OIDAuthorizationService.m @@ -20,8 +20,8 @@ #import "OIDAuthorizationRequest.h" #import "OIDAuthorizationResponse.h" -#import "OIDUserAgentUICoordinator.h" -#import "OIDUserAgentFlowSession.h" +#import "OIDExternalUserAgentUICoordinator.h" +#import "OIDExternalUserAgentFlowSession.h" #import "OIDDefines.h" #import "OIDErrorUtilities.h" #import "OIDRegistrationRequest.h" @@ -41,10 +41,10 @@ NS_ASSUME_NONNULL_BEGIN -@interface OIDAuthorizationFlowSessionImplementation : NSObject { +@interface OIDAuthorizationFlowSessionImplementation : NSObject { // private variables OIDAuthorizationRequest *_request; - id _UICoordinator; + id _UICoordinator; OIDAuthorizationCallback _pendingauthorizationFlowCallback; } @@ -65,12 +65,12 @@ - (instancetype)initWithRequest:(OIDAuthorizationRequest *)request { return self; } -- (void)presentAuthorizationWithCoordinator:(id)UICoordinator +- (void)presentAuthorizationWithCoordinator:(id)UICoordinator callback:(OIDAuthorizationCallback)authorizationFlowCallback { _UICoordinator = UICoordinator; _pendingauthorizationFlowCallback = authorizationFlowCallback; BOOL authorizationFlowStarted = - [_UICoordinator presentUserAgentRequest:_request session:self]; + [_UICoordinator presentExternalUserAgentRequest:_request session:self]; if (!authorizationFlowStarted) { NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeSafariOpenError underlyingError:nil @@ -80,14 +80,13 @@ - (void)presentAuthorizationWithCoordinator:(id)UICoo } - (void)cancel { - [_UICoordinator dismissUserAgentUIAnimated:YES - completion:^{ - NSError *error = [OIDErrorUtilities - errorWithCode:OIDErrorCodeUserCanceledAuthorizationFlow - underlyingError:nil - description:nil]; - [self didFinishWithResponse:nil error:error]; - }]; + [_UICoordinator dismissExternalUserAgentUIAnimated:YES completion:^{ + NSError *error = [OIDErrorUtilities + errorWithCode:OIDErrorCodeUserCanceledAuthorizationFlow + underlyingError:nil + description:nil]; + [self didFinishWithResponse:nil error:error]; + }]; } - (BOOL)shouldHandleURL:(NSURL *)URL { @@ -102,7 +101,7 @@ - (BOOL)shouldHandleURL:(NSURL *)URL { OIDIsEqualIncludingNil(standardizedURL.path, standardizedRedirectURL.path); } -- (BOOL)resumeUserAgentFlowWithURL:(NSURL *)URL { +- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL { // rejects URLs that don't match redirect (these may be completely unrelated to the authorization) if (![self shouldHandleURL:URL]) { return NO; @@ -146,15 +145,14 @@ - (BOOL)resumeUserAgentFlowWithURL:(NSURL *)URL { } } - [_UICoordinator dismissUserAgentUIAnimated:YES - completion:^{ - [self didFinishWithResponse:response error:error]; - }]; + [_UICoordinator dismissExternalUserAgentUIAnimated:YES completion:^{ + [self didFinishWithResponse:response error:error]; + }]; return YES; } -- (void)failUserAgentFlowWithError:(NSError *)error { +- (void)failExternalUserAgentFlowWithError:(NSError *)error { [self didFinishWithResponse:nil error:error]; } @@ -246,9 +244,9 @@ + (void)discoverServiceConfigurationForDiscoveryURL:(NSURL *)discoveryURL #pragma mark - Authorization Endpoint -+ (id) ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request - UICoordinator:(id)UICoordinator + UICoordinator:(id)UICoordinator callback:(OIDAuthorizationCallback)callback { OIDAuthorizationFlowSessionImplementation *flowSession = [[OIDAuthorizationFlowSessionImplementation alloc] initWithRequest:request]; diff --git a/Source/OIDUserAgentFlowSession.h b/Source/OIDExternalUserAgentFlowSession.h similarity index 70% rename from Source/OIDUserAgentFlowSession.h rename to Source/OIDExternalUserAgentFlowSession.h index e941a28a7..2123bd2ce 100644 --- a/Source/OIDUserAgentFlowSession.h +++ b/Source/OIDExternalUserAgentFlowSession.h @@ -1,4 +1,4 @@ -/*! @file OIDUserAgentFlowSession.h +/*! @file OIDExternalUserAgentFlowSession.h @brief AppAuth iOS SDK @copyright Copyright 2017 The AppAuth Authors. All Rights Reserved. @@ -17,21 +17,21 @@ */ -/*! @brief Represents an in-flight user-agent flow session. +/*! @brief Represents an in-flight external user-agent flow session. */ -@protocol OIDUserAgentFlowSession +@protocol OIDExternalUserAgentFlowSession /*! @brief Cancels the code flow session, invoking the request's callback with a cancelled error. @remarks Has no effect if called more than once, or after a - @c OIDUserAgentFlowSession.resumeUserAgentFlowWithURL: message was received. Will - cause an error with code: @c ::OIDErrorCodeProgramCanceledAuthorizationFlow to be passed to - the @c callback block passed to + @c OIDExternalUserAgentFlowSession.resumeExternalUserAgentFlowWithURL: message was received. + Will cause an error with code: @c ::OIDErrorCodeProgramCanceledAuthorizationFlow to be + passed to the @c callback block passed to @c OIDAuthorizationService.presentAuthorizationRequest:presentingViewController:callback: */ - (void)cancel; -/*! @brief Clients should call this method with the result of the user-agent code flow if it - becomes available. +/*! @brief Clients should call this method with the result of the external user-agent code flow if + it becomes available. @param URL The redirect URL invoked by the server. @discussion When the URL represented a valid response, implementations should clean up any left-over UI state from the request, for example by closing the @@ -40,13 +40,13 @@ @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)resumeUserAgentFlowWithURL:(NSURL *)URL; +- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL; -/*! @brief @c OIDUserAgentUICoordinator or clients should call this method when the user-agent flow - failed with a non-OAuth error. - @param error The error that is the reason for the failure of this user-agent flow. +/*! @brief @c OIDExternalUserAgentUICoordinator or clients should call this method when the + external user-agent flow failed with a non-OAuth error. + @param error The error that is the reason for the failure of this external flow. @remarks Has no effect if called more than once, or after a @c cancel message was received. */ -- (void)failUserAgentFlowWithError:(NSError *)error; +- (void)failExternalUserAgentFlowWithError:(NSError *)error; @end diff --git a/Source/OIDUserAgentRequest.h b/Source/OIDExternalUserAgentRequest.h similarity index 63% rename from Source/OIDUserAgentRequest.h rename to Source/OIDExternalUserAgentRequest.h index 1880a23dc..18cff8f45 100644 --- a/Source/OIDUserAgentRequest.h +++ b/Source/OIDExternalUserAgentRequest.h @@ -1,4 +1,4 @@ -/*! @file OIDUserAgentUICoordinator.h +/*! @file OIDExternalUserAgentUICoordinator.h @brief AppAuth iOS SDK @copyright Copyright 2017 The AppAuth Authors. All Rights Reserved. @@ -16,20 +16,20 @@ limitations under the License. */ -/*! @protocol OIDUserAgentUICoordinator - @brief An interface that any user-agent request may implement to use the @c - OIDUserAgentUICoordinator flow. +/*! @protocol OIDExternalUserAgentUICoordinator + @brief An interface that any external user-agent request may implement to use the + @c OIDExternalUserAgentUICoordinator flow. */ -@protocol OIDUserAgentRequest +@protocol OIDExternalUserAgentRequest /*! @brief Method to create and return the complete request URL instance. - @return A @c NSURL instance which contains the URL to be opened in a user-agent (i.e. browser) + @return A @c NSURL instance which contains the URL to be opened in an external UI (i.e. browser) */ -- (NSURL*)userAgentRequestURL; +- (NSURL*)externalUserAgentRequestURL; -/*! @brief If this user-agent request has a redirect URL, this should return its scheme. Since some - user-agent requests have optional callbacks (such as the end session endpoint), the return - value of this method is nullable. +/*! @brief If this external user-agent request has a redirect URL, this should return its scheme. + Since some external requests have optional callbacks (such as the end session endpoint), the + return value of this method is nullable. @return A @c NSString instance that contains the scheme of a callback url, or nil if there is no callback url for this request. */ diff --git a/Source/OIDUserAgentUICoordinator.h b/Source/OIDExternalUserAgentUICoordinator.h similarity index 51% rename from Source/OIDUserAgentUICoordinator.h rename to Source/OIDExternalUserAgentUICoordinator.h index 4fbe2a1ec..1941e72b0 100644 --- a/Source/OIDUserAgentUICoordinator.h +++ b/Source/OIDExternalUserAgentUICoordinator.h @@ -1,4 +1,4 @@ -/*! @file OIDUserAgentUICoordinator.h +/*! @file OIDExternalUserAgentUICoordinator.h @brief AppAuth iOS SDK @copyright Copyright 2016 Google Inc. All Rights Reserved. @@ -18,35 +18,35 @@ #import -@protocol OIDUserAgentFlowSession; -@protocol OIDUserAgentRequest; +@protocol OIDExternalUserAgentFlowSession; +@protocol OIDExternalUserAgentRequest; NS_ASSUME_NONNULL_BEGIN -/*! @protocol OIDUserAgentUICoordinator - @brief An user-agent UI coordinator that presents a request. Clients may provide custom - implementations of an user-agent UI coordinator to customize the way the requests are +/*! @protocol OIDExternalUserAgentUICoordinator + @brief An external user-agent UI coordinator that presents a request. Clients may provide custom + implementations of an external UI coordinator to customize the way the requests are presented to the end user. */ -@protocol OIDUserAgentUICoordinator +@protocol OIDExternalUserAgentUICoordinator -/*! @brief Presents the user-agent request in the UI coordinator. +/*! @brief Presents the external user-agent request in the UI coordinator. @param request The request to be presented in the UI. - @param session The @c OIDUserAgentFlowSession instance that initiates presenting the UI. - Concrete implementations of a @c OIDUserAgentUICoordinator may call - resumeUserAgentFlowWithURL or failUserAgentFlowWithError on session to either + @param session The @c OIDExternalUserAgentFlowSession instance that initiates presenting the UI. + Concrete implementations of a @c OIDExternalUserAgentUICoordinator may call + resumeExternalUserAgentFlowWithURL or failExternalUserAgentFlowWithError on session to either resume or fail the request. @return YES If the request UI was successfully presented to the user. */ -- (BOOL)presentUserAgentRequest:(id )request - session:(id)session; +- (BOOL)presentExternalUserAgentRequest:(id )request + session:(id)session; -/*! @brief Dimisses the user-agent UI and calls completion when the dismiss operation ends. +/*! @brief Dimisses the external user-agent UI and calls completion when the dismiss operation ends. @param animated Wheter or not the dismiss operation should be animated. @remarks Has no effect if no UI is presented. @param completion The block to be called when the dismiss operations ends */ -- (void)dismissUserAgentUIAnimated:(BOOL)animated completion:(void (^)(void))completion; +- (void)dismissExternalUserAgentUIAnimated:(BOOL)animated completion:(void (^)(void))completion; @end diff --git a/Source/iOS/OIDAuthState+IOS.h b/Source/iOS/OIDAuthState+IOS.h index 5f764be43..fbf4d2b19 100644 --- a/Source/iOS/OIDAuthState+IOS.h +++ b/Source/iOS/OIDAuthState+IOS.h @@ -32,11 +32,11 @@ NS_ASSUME_NONNULL_BEGIN @param presentingViewController The view controller from which to present the @c SFSafariViewController. @param callback The method called when the request has completed or failed. - @return A @c OIDUserAgentFlowSession instance which will terminate when it - receives a @c OIDUserAgentFlowSession.cancel message, or after processing a - @c OIDUserAgentFlowSession.resumeAuthorizationFlowWithURL: message. + @return A @c OIDExternalUserAgentFlowSession instance which will terminate when it + receives a @c OIDExternalUserAgentFlowSession.cancel message, or after processing a + @c OIDExternalUserAgentFlowSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest presentingViewController:(UIViewController *)presentingViewController callback:(OIDAuthStateAuthorizationCallback)callback; diff --git a/Source/iOS/OIDAuthState+IOS.m b/Source/iOS/OIDAuthState+IOS.m index c68ddd22b..0129524c2 100644 --- a/Source/iOS/OIDAuthState+IOS.m +++ b/Source/iOS/OIDAuthState+IOS.m @@ -18,15 +18,15 @@ #import "OIDAuthState+IOS.h" -#import "OIDUserAgentUICoordinatorIOS.h" +#import "OIDExternalUserAgentUICoordinatorIOS.h" @implementation OIDAuthState (IOS) -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest presentingViewController:(UIViewController *)presentingViewController callback:(OIDAuthStateAuthorizationCallback)callback { - OIDUserAgentUICoordinatorIOS *coordinator = [[OIDUserAgentUICoordinatorIOS alloc] + OIDExternalUserAgentUICoordinatorIOS *coordinator = [[OIDExternalUserAgentUICoordinatorIOS alloc] initWithPresentingViewController:presentingViewController]; return [self authStateByPresentingAuthorizationRequest:authorizationRequest UICoordinator:coordinator diff --git a/Source/iOS/OIDAuthorizationService+IOS.h b/Source/iOS/OIDAuthorizationService+IOS.h index d99ff1df2..91ca35748 100644 --- a/Source/iOS/OIDAuthorizationService+IOS.h +++ b/Source/iOS/OIDAuthorizationService+IOS.h @@ -19,7 +19,7 @@ #import #import "OIDAuthorizationService.h" -#import "OIDUserAgentFlowSession.h" +#import "OIDExternalUserAgentFlowSession.h" NS_ASSUME_NONNULL_BEGIN @@ -32,11 +32,11 @@ NS_ASSUME_NONNULL_BEGIN @param presentingViewController The view controller from which to present the \SFSafariViewController. @param callback The method called when the request has completed or failed. - @return A @c OIDUserAgentFlowSession instance which will terminate when it - receives a @c OIDUserAgentFlowSession.cancel message, or after processing a - @c OIDUserAgentFlowSession.resumeUserAgentFlowWithURL: message. + @return A @c OIDExternalUserAgentFlowSession instance which will terminate when it + receives a @c OIDExternalUserAgentFlowSession.cancel message, or after processing a + @c OIDExternalUserAgentFlowSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request presentingViewController:(UIViewController *)presentingViewController callback:(OIDAuthorizationCallback)callback; diff --git a/Source/iOS/OIDAuthorizationService+IOS.m b/Source/iOS/OIDAuthorizationService+IOS.m index 7ec0cda5f..8e34b042c 100644 --- a/Source/iOS/OIDAuthorizationService+IOS.m +++ b/Source/iOS/OIDAuthorizationService+IOS.m @@ -18,17 +18,17 @@ #import "OIDAuthorizationService+IOS.h" -#import "OIDUserAgentUICoordinatorIOS.h" +#import "OIDExternalUserAgentUICoordinatorIOS.h" NS_ASSUME_NONNULL_BEGIN @implementation OIDAuthorizationService (IOS) -+ (id) ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request presentingViewController:(UIViewController *)presentingViewController callback:(OIDAuthorizationCallback)callback { - OIDUserAgentUICoordinatorIOS *coordinator = [[OIDUserAgentUICoordinatorIOS alloc] + OIDExternalUserAgentUICoordinatorIOS *coordinator = [[OIDExternalUserAgentUICoordinatorIOS alloc] initWithPresentingViewController:presentingViewController]; return [self presentAuthorizationRequest:request UICoordinator:coordinator callback:callback]; } diff --git a/Source/iOS/OIDUserAgentUICoordinatorIOS.h b/Source/iOS/OIDExternalUserAgentUICoordinatorIOS.h similarity index 88% rename from Source/iOS/OIDUserAgentUICoordinatorIOS.h rename to Source/iOS/OIDExternalUserAgentUICoordinatorIOS.h index 357967cac..aeddbddfa 100644 --- a/Source/iOS/OIDUserAgentUICoordinatorIOS.h +++ b/Source/iOS/OIDExternalUserAgentUICoordinatorIOS.h @@ -1,4 +1,4 @@ -/*! @file OIDUserAgentUICoordinatorIOS.h +/*! @file OIDExternalUserAgentUICoordinatorIOS.h @brief AppAuth iOS SDK @copyright Copyright 2016 Google Inc. All Rights Reserved. @@ -18,7 +18,7 @@ #import -#import "OIDUserAgentUICoordinator.h" +#import "OIDExternalUserAgentUICoordinator.h" @class SFSafariViewController; @@ -36,10 +36,10 @@ NS_ASSUME_NONNULL_BEGIN @end -/*! @brief An iOS specific user-agent UI Coordinator that uses a \SFSafariViewController to +/*! @brief An iOS specific external user-agent UI Coordinator that uses a \SFSafariViewController to present an user-agent request. */ -@interface OIDUserAgentUICoordinatorIOS : NSObject +@interface OIDExternalUserAgentUICoordinatorIOS : NSObject /*! @brief Allows library consumers to change the @c OIDSafariViewControllerFactory used to create new instances of @c SFSafariViewController. diff --git a/Source/iOS/OIDUserAgentUICoordinatorIOS.m b/Source/iOS/OIDExternalUserAgentUICoordinatorIOS.m similarity index 83% rename from Source/iOS/OIDUserAgentUICoordinatorIOS.m rename to Source/iOS/OIDExternalUserAgentUICoordinatorIOS.m index b0257d0ea..37ab4c87b 100644 --- a/Source/iOS/OIDUserAgentUICoordinatorIOS.m +++ b/Source/iOS/OIDExternalUserAgentUICoordinatorIOS.m @@ -16,13 +16,13 @@ limitations under the License. */ -#import "OIDUserAgentUICoordinatorIOS.h" +#import "OIDExternalUserAgentUICoordinatorIOS.h" #import #import "OIDErrorUtilities.h" -#import "OIDUserAgentRequest.h" -#import "OIDUserAgentFlowSession.h" +#import "OIDExternalUserAgentRequest.h" +#import "OIDExternalUserAgentFlowSession.h" NS_ASSUME_NONNULL_BEGIN @@ -37,14 +37,14 @@ @interface OIDDefaultSafariViewControllerFactory : NSObject @end -@interface OIDUserAgentUICoordinatorIOS () +@interface OIDExternalUserAgentUICoordinatorIOS () @end -@implementation OIDUserAgentUICoordinatorIOS { +@implementation OIDExternalUserAgentUICoordinatorIOS { UIViewController *_presentingViewController; - BOOL _userAgentFlowInProgress; - __weak id _session; + BOOL _externalUserAgentFlowInProgress; + __weak id _session; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpartial-availability" __weak SFSafariViewController *_safariVC; @@ -76,17 +76,17 @@ - (nullable instancetype)initWithPresentingViewController: return self; } -- (BOOL)presentUserAgentRequest:(id)request - session:(id)session { - if (_userAgentFlowInProgress) { +- (BOOL)presentExternalUserAgentRequest:(id)request + session:(id)session { + if (_externalUserAgentFlowInProgress) { // TODO: Handle errors as authorization is already in progress. return NO; } - _userAgentFlowInProgress = YES; + _externalUserAgentFlowInProgress = YES; _session = session; BOOL openedSafari = NO; - NSURL *requestURL = [request userAgentRequestURL]; + NSURL *requestURL = [request externalUserAgentRequestURL]; if (@available(iOS 11.0, *)) { NSString *redirectScheme = request.redirectScheme; @@ -97,13 +97,13 @@ - (BOOL)presentUserAgentRequest:(id)request NSError * _Nullable error) { _authenticationVC = nil; if (callbackURL) { - [_session resumeUserAgentFlowWithURL:callbackURL]; + [_session resumeExternalUserAgentFlowWithURL:callbackURL]; } else { NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeUserCanceledAuthorizationFlow underlyingError:error description:nil]; - [_session failUserAgentFlowWithError:safariError]; + [_session failExternalUserAgentFlowWithError:safariError]; } }]; _authenticationVC = authenticationVC; @@ -124,13 +124,13 @@ - (BOOL)presentUserAgentRequest:(id)request NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeSafariOpenError underlyingError:nil description:@"Unable to open Safari."]; - [session failUserAgentFlowWithError:safariError]; + [session failExternalUserAgentFlowWithError:safariError]; } return openedSafari; } -- (void)dismissUserAgentUIAnimated:(BOOL)animated completion:(void (^)(void))completion { - if (!_userAgentFlowInProgress) { +- (void)dismissExternalUserAgentUIAnimated:(BOOL)animated completion:(void (^)(void))completion { + if (!_externalUserAgentFlowInProgress) { // Ignore this call if there is no authorization flow in progress. return; } @@ -163,7 +163,7 @@ - (void)cleanUp { _safariVC = nil; _authenticationVC = nil; _session = nil; - _userAgentFlowInProgress = NO; + _externalUserAgentFlowInProgress = NO; } #pragma mark - SFSafariViewControllerDelegate @@ -173,16 +173,16 @@ - (void)safariViewControllerDidFinish:(SFSafariViewController *)controller NS_AV // Ignore this call if the safari view controller do not match. return; } - if (!_userAgentFlowInProgress) { + if (!_externalUserAgentFlowInProgress) { // Ignore this call if there is no authorization flow in progress. return; } - id session = _session; + id session = _session; [self cleanUp]; NSError *error = [OIDErrorUtilities errorWithCode:OIDErrorCodeProgramCanceledAuthorizationFlow underlyingError:nil description:nil]; - [session failUserAgentFlowWithError:error]; + [session failExternalUserAgentFlowWithError:error]; } @end diff --git a/Source/macOS/OIDAuthState+Mac.h b/Source/macOS/OIDAuthState+Mac.h index 79a870510..8a3140959 100644 --- a/Source/macOS/OIDAuthState+Mac.h +++ b/Source/macOS/OIDAuthState+Mac.h @@ -28,11 +28,11 @@ NS_ASSUME_NONNULL_BEGIN and performing the authorization code exchange in the case of code flow requests. @param authorizationRequest The authorization request to present. @param callback The method called when the request has completed or failed. - @return A @c OIDUserAgentFlowSession instance which will terminate when it - receives a @c OIDUserAgentFlowSession.cancel message, or after processing a - @c OIDUserAgentFlowSession.resumeUserAgentFlowWithURL: message. + @return A @c OIDExternalUserAgentFlowSession instance which will terminate when it + receives a @c OIDExternalUserAgentFlowSession.cancel message, or after processing a + @c OIDExternalUserAgentFlowSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest callback:(OIDAuthStateAuthorizationCallback)callback; @end diff --git a/Source/macOS/OIDAuthState+Mac.m b/Source/macOS/OIDAuthState+Mac.m index b0b3d3ba6..8ec007f9b 100644 --- a/Source/macOS/OIDAuthState+Mac.m +++ b/Source/macOS/OIDAuthState+Mac.m @@ -18,14 +18,14 @@ #import "OIDAuthState+Mac.h" -#import "OIDUserAgentUICoordinatorMac.h" +#import "OIDExternalUserAgentUICoordinatorMac.h" @implementation OIDAuthState (Mac) -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest callback:(OIDAuthStateAuthorizationCallback)callback { - OIDUserAgentUICoordinatorMac *coordinator = [[OIDUserAgentUICoordinatorMac alloc] init]; + OIDExternalUserAgentUICoordinatorMac *coordinator = [[OIDExternalUserAgentUICoordinatorMac alloc] init]; return [self authStateByPresentingAuthorizationRequest:authorizationRequest UICoordinator:coordinator callback:callback]; diff --git a/Source/macOS/OIDAuthorizationService+Mac.h b/Source/macOS/OIDAuthorizationService+Mac.h index d5a3324fb..556f79024 100644 --- a/Source/macOS/OIDAuthorizationService+Mac.h +++ b/Source/macOS/OIDAuthorizationService+Mac.h @@ -27,11 +27,11 @@ NS_ASSUME_NONNULL_BEGIN /*! @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. - @return A @c OIDUserAgentFlowSession instance which will terminate when it - receives a @c OIDUserAgentFlowSession.cancel message, or after processing a - @c OIDUserAgentFlowSession.resumeUserAgentFlowWithURL: message. + @return A @c OIDExternalUserAgentFlowSession instance which will terminate when it + receives a @c OIDExternalUserAgentFlowSession.cancel message, or after processing a + @c OIDExternalUserAgentFlowSession.resumeExternalUserAgentFlowWithURL: message. */ -+ (id)presentAuthorizationRequest:(OIDAuthorizationRequest *)request ++ (id)presentAuthorizationRequest:(OIDAuthorizationRequest *)request callback:(OIDAuthorizationCallback)callback; @end diff --git a/Source/macOS/OIDAuthorizationService+Mac.m b/Source/macOS/OIDAuthorizationService+Mac.m index c97f854a5..cd8fa9124 100644 --- a/Source/macOS/OIDAuthorizationService+Mac.m +++ b/Source/macOS/OIDAuthorizationService+Mac.m @@ -18,15 +18,15 @@ #import "OIDAuthorizationService+Mac.h" -#import "OIDUserAgentUICoordinatorMac.h" +#import "OIDExternalUserAgentUICoordinatorMac.h" NS_ASSUME_NONNULL_BEGIN @implementation OIDAuthorizationService (Mac) -+ (id)presentAuthorizationRequest:(OIDAuthorizationRequest *)request ++ (id)presentAuthorizationRequest:(OIDAuthorizationRequest *)request callback:(OIDAuthorizationCallback)callback { - OIDUserAgentUICoordinatorMac *coordinator = [[OIDUserAgentUICoordinatorMac alloc] init]; + OIDExternalUserAgentUICoordinatorMac *coordinator = [[OIDExternalUserAgentUICoordinatorMac alloc] init]; return [self presentAuthorizationRequest:request UICoordinator:coordinator callback:callback]; } diff --git a/Source/macOS/OIDUserAgentUICoordinatorMac.h b/Source/macOS/OIDExternalUserAgentUICoordinatorMac.h similarity index 68% rename from Source/macOS/OIDUserAgentUICoordinatorMac.h rename to Source/macOS/OIDExternalUserAgentUICoordinatorMac.h index 94c567fbe..81c747111 100644 --- a/Source/macOS/OIDUserAgentUICoordinatorMac.h +++ b/Source/macOS/OIDExternalUserAgentUICoordinatorMac.h @@ -1,4 +1,4 @@ -/*! @file OIDUserAgentUICoordinatorMac.h +/*! @file OIDExternalUserAgentUICoordinatorMac.h @brief AppAuth iOS SDK @copyright Copyright 2016 Google Inc. All Rights Reserved. @@ -16,17 +16,17 @@ limitations under the License. */ -#import "OIDUserAgentUICoordinator.h" +#import "OIDExternalUserAgentUICoordinator.h" NS_ASSUME_NONNULL_BEGIN -/*! @brief A Mac-specific user-agent UI Coordinator that uses the default browser to +/*! @brief A Mac-specific external user-agent UI Coordinator that uses the default browser to present a request. */ -@interface OIDUserAgentUICoordinatorMac : NSObject { +@interface OIDExternalUserAgentUICoordinatorMac : NSObject { // private variables - BOOL _userAgentFlowInProgress; - __weak id _session; + BOOL _externalUserAgentFlowInProgress; + __weak id _session; } @end diff --git a/Source/macOS/OIDUserAgentUICoordinatorMac.m b/Source/macOS/OIDExternalUserAgentUICoordinatorMac.m similarity index 67% rename from Source/macOS/OIDUserAgentUICoordinatorMac.m rename to Source/macOS/OIDExternalUserAgentUICoordinatorMac.m index 189a09546..d27979920 100644 --- a/Source/macOS/OIDUserAgentUICoordinatorMac.m +++ b/Source/macOS/OIDExternalUserAgentUICoordinatorMac.m @@ -1,4 +1,4 @@ -/*! @file OIDUserAgentUICoordinatorMac.m +/*! @file OIDExternalUserAgentUICoordinatorMac.m @brief AppAuth iOS SDK @copyright Copyright 2016 Google Inc. All Rights Reserved. @@ -16,28 +16,28 @@ limitations under the License. */ -#import "OIDUserAgentUICoordinatorMac.h" +#import "OIDExternalUserAgentUICoordinatorMac.h" #import #import "OIDErrorUtilities.h" -#import "OIDUserAgentRequest.h" -#import "OIDUserAgentFlowSession.h" +#import "OIDExternalUserAgentRequest.h" +#import "OIDExternalUserAgentFlowSession.h" NS_ASSUME_NONNULL_BEGIN -@implementation OIDUserAgentUICoordinatorMac +@implementation OIDExternalUserAgentUICoordinatorMac -- (BOOL)presentUserAgentRequest:(id)request - session:(id)session { - if (_userAgentFlowInProgress) { +- (BOOL)presentExternalUserAgentRequest:(id)request + session:(id)session { + if (_externalUserAgentFlowInProgress) { // TODO: Handle errors as authorization is already in progress. return NO; } - _userAgentFlowInProgress = YES; + _externalUserAgentFlowInProgress = YES; _session = session; - NSURL *requestURL = [request userAgentRequestURL]; + NSURL *requestURL = [request externalUserAgentRequestURL]; BOOL openedBrowser = [[NSWorkspace sharedWorkspace] openURL:requestURL]; if (!openedBrowser) { @@ -45,13 +45,13 @@ - (BOOL)presentUserAgentRequest:(id)request NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeBrowserOpenError underlyingError:nil description:@"Unable to open the browser."]; - [session failUserAgentFlowWithError:safariError]; + [session failExternalUserAgentFlowWithError:safariError]; } return openedBrowser; } -- (void)dismissUserAgentUIAnimated:(BOOL)animated completion:(void (^)(void))completion { - if (!_userAgentFlowInProgress) { +- (void)dismissExternalUserAgentUIAnimated:(BOOL)animated completion:(void (^)(void))completion { + if (!_externalUserAgentFlowInProgress) { // Ignore this call if there is no authorization flow in progress. return; } @@ -63,7 +63,7 @@ - (void)dismissUserAgentUIAnimated:(BOOL)animated completion:(void (^)(void))com - (void)cleanUp { _session = nil; - _userAgentFlowInProgress = NO; + _externalUserAgentFlowInProgress = NO; } @end diff --git a/Source/macOS/OIDRedirectHTTPHandler.h b/Source/macOS/OIDRedirectHTTPHandler.h index 64039762e..9a7c3b21d 100644 --- a/Source/macOS/OIDRedirectHTTPHandler.h +++ b/Source/macOS/OIDRedirectHTTPHandler.h @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN @class HTTPServer; -@protocol OIDUserAgentFlowSession; +@protocol OIDExternalUserAgentFlowSession; /*! @brief Start a HTTP server on the loopback interface (i.e. @c 127.0.0.1) to receive the OAuth response redirects on macOS. @@ -31,30 +31,31 @@ NS_ASSUME_NONNULL_BEGIN HTTPServer *_httpServ; NSURL *_successURL; // property variables - NSObject *_currentUserAgentFlow; + NSObject *_currentExternalUserAgentFlow; } -/*! @brief The user-agent request flow session which receives the return URL from the browser. +/*! @brief The external user-agent request flow session which receives the return URL from the + browser. @discussion The loopback HTTP server will try sending incoming request URLs to the OAuth - redirect handler to continue the flow. This should be set while a user-agent request flow is - in progress. + 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 currentUserAgentFlow; +@property(nonatomic, strong, nullable) id currentExternalUserAgentFlow; /*! @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 request flow completes either with a result of success or error. The contents of this page should instruct the user to return to the app. - @discussion Once you have initiated the user-agent request, be sure to set - @c currentUserAgentFlow on this object so that any responses received by this listener will + @discussion Once you have initiated the external user-agent request, be sure to set + @c currentExternalUserAgentFlow on this object so that any responses received by this listener will be routed accordingly. */ - (instancetype)initWithSuccessURL:(nullable NSURL *)successURL; /*! @brief Starts listening on the loopback interface on a random available port, and returns a URL - with the base address. Use the returned redirect URI to build a @c OIDUserAgentRequest, - and once you initiate the request, set the resulting @c OIDUserAgentFlowSession to - @c currentUserAgentFlow so the response can be handled. + with the base address. Use the returned redirect URI to build a @c OIDExternalUserAgentRequest, + and once you initiate the request, set the resulting @c OIDExternalUserAgentFlowSession to + @c currentExternalUserAgentFlow so the response can be handled. @param error The error if an error occurred while starting the local HTTP server. @return The URL containing the address of the server with the randomly assigned available port. @discussion Each instance of @c OIDRedirectHTTPHandler can only listen for a single response. @@ -65,10 +66,10 @@ NS_ASSUME_NONNULL_BEGIN /*! @brief Stops listening the loopback interface and sends an cancellation error (in the domain ::OIDGeneralErrorDomain, with the code ::OIDErrorCodeProgramCanceledAuthorizationFlow) to - the @c currentUserAgentFlow. Has no effect if called when no requests are pending. + the @c currentExternalUserAgentFlow. Has no effect if called when no requests are pending. @discussion The HTTP listener is stopped automatically on receiving a valid response (regardless of whether the request succeeded or not), this method should not be called except when - abandoning the user-agent request. + abandoning the external user-agent request. */ - (void)cancelHTTPListener; diff --git a/Source/macOS/OIDRedirectHTTPHandler.m b/Source/macOS/OIDRedirectHTTPHandler.m index c6fefb9b5..b67be5749 100644 --- a/Source/macOS/OIDRedirectHTTPHandler.m +++ b/Source/macOS/OIDRedirectHTTPHandler.m @@ -21,7 +21,7 @@ #import "OIDAuthorizationService.h" #import "OIDErrorUtilities.h" #import "OIDLoopbackHTTPServer.h" -#import "OIDUserAgentFlowSession.h" +#import "OIDExternalUserAgentFlowSession.h" /*! @brief Page that is returned following a completed authorization. Show your own page instead by supplying a URL in @c initWithSuccessURL that the user will be redirected to. @@ -49,7 +49,7 @@ @implementation OIDRedirectHTTPHandler -@synthesize currentUserAgentFlow = _currentUserAgentFlow; +@synthesize currentExternalUserAgentFlow = _currentExternalUserAgentFlow; - (instancetype)init { return [self initWithSuccessURL:nil]; @@ -98,8 +98,8 @@ - (void)cancelHTTPListener { [OIDErrorUtilities errorWithCode:OIDErrorCodeProgramCanceledAuthorizationFlow underlyingError:nil description:@"The HTTP listener was cancelled programmatically."]; - [_currentUserAgentFlow failUserAgentFlowWithError:cancelledError]; - _currentUserAgentFlow = nil; + [_currentExternalUserAgentFlow failExternalUserAgentFlowWithError:cancelledError]; + _currentExternalUserAgentFlow = nil; } /*! @brief Stops listening on the loopback interface without modifying the state of the @@ -115,11 +115,11 @@ - (void)stopHTTPListener { - (void)HTTPConnection:(HTTPConnection *)conn didReceiveRequest:(HTTPServerRequest *)mess { // Sends URL to AppAuth. CFURLRef url = CFHTTPMessageCopyRequestURL(mess.request); - BOOL handled = [_currentUserAgentFlow resumeUserAgentFlowWithURL:(__bridge NSURL *)url]; + BOOL handled = [_currentExternalUserAgentFlow resumeExternalUserAgentFlowWithURL:(__bridge NSURL *)url]; // Stops listening to further requests after the first valid authorization response. if (handled) { - _currentUserAgentFlow = nil; + _currentExternalUserAgentFlow = nil; [self stopHTTPListener]; } @@ -128,7 +128,7 @@ - (void)HTTPConnection:(HTTPConnection *)conn didReceiveRequest:(HTTPServerReque NSInteger httpResponseCode = (_successURL) ? 302 : 200; // Returns an error page if a URL other than the expected redirect is requested. if (!handled) { - if (_currentUserAgentFlow) { + if (_currentExternalUserAgentFlow) { bodyText = kHTMLErrorRedirectNotValid; httpResponseCode = 404; } else {