diff --git a/AppAuth.xcodeproj/project.pbxproj b/AppAuth.xcodeproj/project.pbxproj index 6657b7c8b..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 /* OIDAuthorizationUICoordinatorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE281D581FE700EC285B /* OIDAuthorizationUICoordinatorMac.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 */; }; @@ -19,7 +19,6 @@ 340DAEBC1D582AF100EC285B /* OIDRedirectHTTPHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAEBA1D582AF100EC285B /* OIDRedirectHTTPHandler.m */; }; 340DAECB1D582DE100EC285B /* OIDAuthorizationService+IOS.m in Sources */ = {isa = PBXBuildFile; fileRef = F6F60FB11D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.m */; }; 340DAECC1D582DE100EC285B /* OIDAuthState+IOS.m in Sources */ = {isa = PBXBuildFile; fileRef = F6F60FB01D2BFEFE00325CB3 /* OIDAuthState+IOS.m */; }; - 340DAECD1D582DE100EC285B /* OIDAuthorizationUICoordinatorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = F6F60FB21D2BFEFE00325CB3 /* OIDAuthorizationUICoordinatorIOS.m */; }; 341310BE1E6F943C00D5DEE5 /* OIDClientMetadataParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 60140F791DE4276800DA0DC3 /* OIDClientMetadataParameters.m */; }; 341310BF1E6F943C00D5DEE5 /* OIDClientMetadataParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 60140F791DE4276800DA0DC3 /* OIDClientMetadataParameters.m */; }; 341310C21E6F944B00D5DEE5 /* OIDError.m in Sources */ = {isa = PBXBuildFile; fileRef = 341741C01C5D8243000EF209 /* OIDError.m */; }; @@ -120,10 +119,8 @@ 343AAA6B1E83465500F9D36E /* AppAuth.h in Headers */ = {isa = PBXBuildFile; fileRef = 343AAA4D1E8345B600F9D36E /* AppAuth.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAA6C1E83466B00F9D36E /* OIDAuthorizationService+IOS.h in Headers */ = {isa = PBXBuildFile; fileRef = F6F60FB31D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAA6D1E83466B00F9D36E /* OIDAuthState+IOS.h in Headers */ = {isa = PBXBuildFile; fileRef = F6F60FB51D2BFEFE00325CB3 /* OIDAuthState+IOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 343AAA6E1E83466B00F9D36E /* OIDAuthorizationUICoordinatorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = F6F60FB41D2BFEFE00325CB3 /* OIDAuthorizationUICoordinatorIOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAA6F1E83467D00F9D36E /* OIDAuthorizationService+IOS.m in Sources */ = {isa = PBXBuildFile; fileRef = F6F60FB11D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.m */; }; 343AAA701E83467D00F9D36E /* OIDAuthState+IOS.m in Sources */ = {isa = PBXBuildFile; fileRef = F6F60FB01D2BFEFE00325CB3 /* OIDAuthState+IOS.m */; }; - 343AAA711E83467D00F9D36E /* OIDAuthorizationUICoordinatorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = F6F60FB21D2BFEFE00325CB3 /* OIDAuthorizationUICoordinatorIOS.m */; }; 343AAA721E83469600F9D36E /* OIDAuthorizationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 341741B51C5D8243000EF209 /* OIDAuthorizationRequest.m */; }; 343AAA731E8346B400F9D36E /* OIDAuthorizationRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 341742011C5D82D3000EF209 /* OIDAuthorizationRequestTests.m */; }; 343AAA741E8346B400F9D36E /* OIDAuthorizationResponseTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 341742031C5D82D3000EF209 /* OIDAuthorizationResponseTests.m */; }; @@ -162,18 +159,17 @@ 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 /* OIDAuthorizationUICoordinatorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = 340DAE281D581FE700EC285B /* OIDAuthorizationUICoordinatorMac.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 /* OIDAuthorizationUICoordinatorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 340DAE271D581FE700EC285B /* OIDAuthorizationUICoordinatorMac.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 */; }; 343AAAE31E83499000F9D36E /* OIDAuthorizationRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B41C5D8243000EF209 /* OIDAuthorizationRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAE41E83499000F9D36E /* OIDAuthorizationResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B61C5D8243000EF209 /* OIDAuthorizationResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAE51E83499000F9D36E /* OIDAuthorizationService.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B81C5D8243000EF209 /* OIDAuthorizationService.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 343AAAE61E83499000F9D36E /* OIDAuthorizationUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = F68103B61D2568D10053658E /* OIDAuthorizationUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAE71E83499000F9D36E /* OIDAuthState.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BA1C5D8243000EF209 /* OIDAuthState.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAE81E83499000F9D36E /* OIDAuthStateChangeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BC1C5D8243000EF209 /* OIDAuthStateChangeDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAE91E83499000F9D36E /* OIDAuthStateErrorDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BD1C5D8243000EF209 /* OIDAuthStateErrorDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -193,7 +189,6 @@ 343AAAFB1E83499100F9D36E /* OIDAuthorizationRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B41C5D8243000EF209 /* OIDAuthorizationRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAFC1E83499100F9D36E /* OIDAuthorizationResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B61C5D8243000EF209 /* OIDAuthorizationResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAFD1E83499100F9D36E /* OIDAuthorizationService.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B81C5D8243000EF209 /* OIDAuthorizationService.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 343AAAFE1E83499100F9D36E /* OIDAuthorizationUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = F68103B61D2568D10053658E /* OIDAuthorizationUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAAFF1E83499100F9D36E /* OIDAuthState.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BA1C5D8243000EF209 /* OIDAuthState.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB001E83499100F9D36E /* OIDAuthStateChangeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BC1C5D8243000EF209 /* OIDAuthStateChangeDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB011E83499100F9D36E /* OIDAuthStateErrorDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BD1C5D8243000EF209 /* OIDAuthStateErrorDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -213,7 +208,6 @@ 343AAB131E83499200F9D36E /* OIDAuthorizationRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B41C5D8243000EF209 /* OIDAuthorizationRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB141E83499200F9D36E /* OIDAuthorizationResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B61C5D8243000EF209 /* OIDAuthorizationResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB151E83499200F9D36E /* OIDAuthorizationService.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B81C5D8243000EF209 /* OIDAuthorizationService.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 343AAB161E83499200F9D36E /* OIDAuthorizationUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = F68103B61D2568D10053658E /* OIDAuthorizationUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB171E83499200F9D36E /* OIDAuthState.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BA1C5D8243000EF209 /* OIDAuthState.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB181E83499200F9D36E /* OIDAuthStateChangeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BC1C5D8243000EF209 /* OIDAuthStateChangeDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB191E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BD1C5D8243000EF209 /* OIDAuthStateErrorDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -233,7 +227,6 @@ 343AAB2B1E83499200F9D36E /* OIDAuthorizationRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B41C5D8243000EF209 /* OIDAuthorizationRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB2C1E83499200F9D36E /* OIDAuthorizationResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B61C5D8243000EF209 /* OIDAuthorizationResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB2D1E83499200F9D36E /* OIDAuthorizationService.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741B81C5D8243000EF209 /* OIDAuthorizationService.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 343AAB2E1E83499200F9D36E /* OIDAuthorizationUICoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = F68103B61D2568D10053658E /* OIDAuthorizationUICoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB2F1E83499200F9D36E /* OIDAuthState.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BA1C5D8243000EF209 /* OIDAuthState.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB301E83499200F9D36E /* OIDAuthStateChangeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BC1C5D8243000EF209 /* OIDAuthStateChangeDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB311E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 341741BD1C5D8243000EF209 /* OIDAuthStateErrorDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -377,6 +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 /* 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 */ @@ -460,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 /* OIDAuthorizationUICoordinatorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDAuthorizationUICoordinatorMac.h; sourceTree = ""; }; - 340DAE281D581FE700EC285B /* OIDAuthorizationUICoordinatorMac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OIDAuthorizationUICoordinatorMac.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; }; @@ -557,12 +565,14 @@ 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 = ""; }; - F68103B61D2568D10053658E /* OIDAuthorizationUICoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDAuthorizationUICoordinator.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 = ""; }; - F6F60FB21D2BFEFE00325CB3 /* OIDAuthorizationUICoordinatorIOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OIDAuthorizationUICoordinatorIOS.m; path = iOS/OIDAuthorizationUICoordinatorIOS.m; sourceTree = ""; }; F6F60FB31D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OIDAuthorizationService+IOS.h"; path = "iOS/OIDAuthorizationService+IOS.h"; sourceTree = ""; }; - F6F60FB41D2BFEFE00325CB3 /* OIDAuthorizationUICoordinatorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OIDAuthorizationUICoordinatorIOS.h; path = iOS/OIDAuthorizationUICoordinatorIOS.h; sourceTree = ""; }; F6F60FB51D2BFEFE00325CB3 /* OIDAuthState+IOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OIDAuthState+IOS.h"; path = "iOS/OIDAuthState+IOS.h"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -684,8 +694,8 @@ 340DAEBA1D582AF100EC285B /* OIDRedirectHTTPHandler.m */, 340DAE251D581FE700EC285B /* OIDAuthorizationService+Mac.h */, 340DAE261D581FE700EC285B /* OIDAuthorizationService+Mac.m */, - 340DAE271D581FE700EC285B /* OIDAuthorizationUICoordinatorMac.h */, - 340DAE281D581FE700EC285B /* OIDAuthorizationUICoordinatorMac.m */, + 340DAE271D581FE700EC285B /* OIDExternalUserAgentUICoordinatorMac.h */, + 340DAE281D581FE700EC285B /* OIDExternalUserAgentUICoordinatorMac.m */, 340DAE291D581FE700EC285B /* OIDAuthState+Mac.h */, 340DAE2A1D581FE700EC285B /* OIDAuthState+Mac.m */, ); @@ -736,9 +746,11 @@ 341741B71C5D8243000EF209 /* OIDAuthorizationResponse.m */, 341741B81C5D8243000EF209 /* OIDAuthorizationService.h */, 341741B91C5D8243000EF209 /* OIDAuthorizationService.m */, - F68103B61D2568D10053658E /* OIDAuthorizationUICoordinator.h */, 341741BA1C5D8243000EF209 /* OIDAuthState.h */, 341741BB1C5D8243000EF209 /* OIDAuthState.m */, + A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentFlowSession.h */, + A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */, + A6DEAB982018E4A20022AC32 /* OIDExternalUserAgentUICoordinator.h */, 341741BC1C5D8243000EF209 /* OIDAuthStateChangeDelegate.h */, 341741BD1C5D8243000EF209 /* OIDAuthStateErrorDelegate.h */, 60140F781DE4262000DA0DC3 /* OIDClientMetadataParameters.h */, @@ -849,8 +861,8 @@ F6F60FB11D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.m */, F6F60FB51D2BFEFE00325CB3 /* OIDAuthState+IOS.h */, F6F60FB01D2BFEFE00325CB3 /* OIDAuthState+IOS.m */, - F6F60FB41D2BFEFE00325CB3 /* OIDAuthorizationUICoordinatorIOS.h */, - F6F60FB21D2BFEFE00325CB3 /* OIDAuthorizationUICoordinatorIOS.m */, + A6DEABA92018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.h */, + A6DEABA82018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m */, ); name = iOS; sourceTree = ""; @@ -873,9 +885,9 @@ files = ( 343AAAE41E83499000F9D36E /* OIDAuthorizationResponse.h in Headers */, 343AAAF31E83499000F9D36E /* OIDScopes.h in Headers */, + A6DEAB9F2018E4B00022AC32 /* OIDExternalUserAgentRequest.h in Headers */, 343AAAE81E83499000F9D36E /* OIDAuthStateChangeDelegate.h in Headers */, 343AAA6B1E83465500F9D36E /* AppAuth.h in Headers */, - 343AAA6E1E83466B00F9D36E /* OIDAuthorizationUICoordinatorIOS.h in Headers */, 343AAAF21E83499000F9D36E /* OIDResponseTypes.h in Headers */, 343AAAF71E83499000F9D36E /* OIDTokenRequest.h in Headers */, 343AAAF41E83499000F9D36E /* OIDScopeUtilities.h in Headers */, @@ -884,17 +896,19 @@ 343AAAF11E83499000F9D36E /* OIDGrantTypes.h in Headers */, 343AAA6D1E83466B00F9D36E /* OIDAuthState+IOS.h in Headers */, 343AAAEF1E83499000F9D36E /* OIDRegistrationResponse.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 */, 343AAAF01E83499000F9D36E /* OIDRegistrationRequest.h in Headers */, - 343AAAE61E83499000F9D36E /* OIDAuthorizationUICoordinator.h in Headers */, 343AAAE71E83499000F9D36E /* OIDAuthState.h in Headers */, 343AAAED1E83499000F9D36E /* OIDErrorUtilities.h in Headers */, 343AAA6C1E83466B00F9D36E /* OIDAuthorizationService+IOS.h in Headers */, 343AAAE31E83499000F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAAF91E83499000F9D36E /* OIDTokenUtilities.h in Headers */, 343AAAEC1E83499000F9D36E /* OIDError.h in Headers */, + A6DEABAB2018E5C50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -905,13 +919,16 @@ 343AAB041E83499100F9D36E /* OIDError.h in Headers */, 343AAB091E83499100F9D36E /* OIDGrantTypes.h in Headers */, 343AAAFF1E83499100F9D36E /* OIDAuthState.h in Headers */, + A6DEABA52018E4BA0022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */, 343AAB0D1E83499100F9D36E /* OIDServiceConfiguration.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 /* OIDExternalUserAgentUICoordinator.h in Headers */, 343AAB0B1E83499100F9D36E /* OIDScopes.h in Headers */, 343AAB9B1E834A8800F9D36E /* AppAuth.h in Headers */, 343AAB001E83499100F9D36E /* OIDAuthStateChangeDelegate.h in Headers */, @@ -920,7 +937,6 @@ 343AAAFC1E83499100F9D36E /* OIDAuthorizationResponse.h in Headers */, 343AAB0C1E83499100F9D36E /* OIDScopeUtilities.h in Headers */, 343AAB011E83499100F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, - 343AAAFE1E83499100F9D36E /* OIDAuthorizationUICoordinator.h in Headers */, 343AAAFB1E83499100F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAB051E83499100F9D36E /* OIDErrorUtilities.h in Headers */, ); @@ -933,13 +949,16 @@ 343AAB1C1E83499200F9D36E /* OIDError.h in Headers */, 343AAB211E83499200F9D36E /* OIDGrantTypes.h in Headers */, 343AAB171E83499200F9D36E /* OIDAuthState.h in Headers */, + A6DEABA62018E4BA0022AC32 /* OIDExternalUserAgentFlowSession.h in Headers */, 343AAB251E83499200F9D36E /* OIDServiceConfiguration.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 /* OIDExternalUserAgentUICoordinator.h in Headers */, 343AAB231E83499200F9D36E /* OIDScopes.h in Headers */, 343AAB9C1E834A8900F9D36E /* AppAuth.h in Headers */, 343AAB181E83499200F9D36E /* OIDAuthStateChangeDelegate.h in Headers */, @@ -948,7 +967,6 @@ 343AAB141E83499200F9D36E /* OIDAuthorizationResponse.h in Headers */, 343AAB241E83499200F9D36E /* OIDScopeUtilities.h in Headers */, 343AAB191E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, - 343AAB161E83499200F9D36E /* OIDAuthorizationUICoordinator.h in Headers */, 343AAB131E83499200F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAB1D1E83499200F9D36E /* OIDErrorUtilities.h in Headers */, ); @@ -959,12 +977,14 @@ buildActionMask = 2147483647; files = ( 343AAB9D1E834A8A00F9D36E /* AppAuth.h in Headers */, - 343AAADF1E83494400F9D36E /* OIDAuthorizationUICoordinatorMac.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 /* OIDExternalUserAgentRequest.h in Headers */, 343AAB371E83499200F9D36E /* OIDRegistrationResponse.h in Headers */, 343AAB2B1E83499200F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAB3B1E83499200F9D36E /* OIDScopes.h in Headers */, @@ -979,8 +999,8 @@ 343AAB311E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, 343AAB2F1E83499200F9D36E /* OIDAuthState.h in Headers */, 343AAB3E1E83499200F9D36E /* OIDServiceDiscovery.h in Headers */, + A6DEAB9E2018E4AE0022AC32 /* OIDExternalUserAgentUICoordinator.h in Headers */, 343AAADE1E83494400F9D36E /* OIDAuthorizationService+Mac.h in Headers */, - 343AAB2E1E83499200F9D36E /* OIDAuthorizationUICoordinator.h in Headers */, 343AAB301E83499200F9D36E /* OIDAuthStateChangeDelegate.h in Headers */, 343AAB381E83499200F9D36E /* OIDRegistrationRequest.h in Headers */, 343AAB2D1E83499200F9D36E /* OIDAuthorizationService.h in Headers */, @@ -1429,7 +1449,7 @@ 341310C91E6F944B00D5DEE5 /* OIDScopes.m in Sources */, 341310CE1E6F944B00D5DEE5 /* OIDTokenResponse.m in Sources */, 341310C31E6F944B00D5DEE5 /* OIDErrorUtilities.m in Sources */, - 340DAE581D5821A100EC285B /* OIDAuthorizationUICoordinatorMac.m in Sources */, + 340DAE581D5821A100EC285B /* OIDExternalUserAgentUICoordinatorMac.m in Sources */, 340DAE5A1D5821AB00EC285B /* OIDAuthorizationRequest.m in Sources */, 347423E41E7F3C4000D3E6D6 /* OIDAuthorizationResponse.m in Sources */, 340DAE591D5821A100EC285B /* OIDAuthState+Mac.m in Sources */, @@ -1444,6 +1464,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A6DEABAA2018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m in Sources */, 341741E01C5D8243000EF209 /* OIDErrorUtilities.m in Sources */, 341741EA1C5D8243000EF209 /* OIDTokenUtilities.m in Sources */, 341741E21C5D8243000EF209 /* OIDGrantTypes.m in Sources */, @@ -1457,7 +1478,6 @@ 60140F7A1DE4276800DA0DC3 /* OIDClientMetadataParameters.m in Sources */, 341741DE1C5D8243000EF209 /* OIDAuthState.m in Sources */, 341741DD1C5D8243000EF209 /* OIDAuthorizationService.m in Sources */, - 340DAECD1D582DE100EC285B /* OIDAuthorizationUICoordinatorIOS.m in Sources */, 341741EB1C5D8243000EF209 /* OIDURLQueryComponent.m in Sources */, 341741E11C5D8243000EF209 /* OIDFieldMapping.m in Sources */, 039697461FA8258D003D1FB2 /* OIDURLSessionProvider.m in Sources */, @@ -1566,12 +1586,12 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A6DEABAF2018E5D80022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m in Sources */, 343AAA881E83478900F9D36E /* OIDFieldMapping.m in Sources */, 343AAA841E83478900F9D36E /* OIDAuthState.m in Sources */, 343AAA701E83467D00F9D36E /* OIDAuthState+IOS.m in Sources */, 343AAA921E83478900F9D36E /* OIDTokenResponse.m in Sources */, 343AAA871E83478900F9D36E /* OIDErrorUtilities.m in Sources */, - 343AAA711E83467D00F9D36E /* OIDAuthorizationUICoordinatorIOS.m in Sources */, 343AAA811E83477100F9D36E /* OIDURLQueryComponent.m in Sources */, 343AAA721E83469600F9D36E /* OIDAuthorizationRequest.m in Sources */, 343AAA831E83478900F9D36E /* OIDAuthorizationService.m in Sources */, @@ -1714,7 +1734,7 @@ 343AAB4F1E8349AF00F9D36E /* OIDScopes.m in Sources */, 343AAB541E8349AF00F9D36E /* OIDTokenResponse.m in Sources */, 343AAB491E8349AF00F9D36E /* OIDErrorUtilities.m in Sources */, - 343AAADB1E83493D00F9D36E /* OIDAuthorizationUICoordinatorMac.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 cfd3f9c62..6aeba16d4 100644 --- a/Source/AppAuth.h +++ b/Source/AppAuth.h @@ -22,7 +22,7 @@ #import "OIDAuthorizationRequest.h" #import "OIDAuthorizationResponse.h" #import "OIDAuthorizationService.h" -#import "OIDAuthorizationUICoordinator.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 "OIDAuthorizationUICoordinatorIOS.h" +#import "OIDExternalUserAgentUICoordinatorIOS.h" #elif TARGET_OS_MAC #import "OIDAuthState+Mac.h" #import "OIDAuthorizationService+Mac.h" -#import "OIDAuthorizationUICoordinatorMac.h" +#import "OIDExternalUserAgentUICoordinatorMac.h" #import "OIDRedirectHTTPHandler.h" #else #error "Platform Undefined" diff --git a/Source/Framework/AppAuth.h b/Source/Framework/AppAuth.h index 1275e36f2..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 8c5e11b5f..fbd3ac206 100644 --- a/Source/OIDAuthState.h +++ b/Source/OIDAuthState.h @@ -23,10 +23,10 @@ @class OIDRegistrationResponse; @class OIDTokenResponse; @class OIDTokenRequest; -@protocol OIDAuthorizationFlowSession; -@protocol OIDAuthorizationUICoordinator; @protocol OIDAuthStateChangeDelegate; @protocol OIDAuthStateErrorDelegate; +@protocol OIDExternalUserAgentUICoordinator; +@protocol OIDExternalUserAgentFlowSession; NS_ASSUME_NONNULL_BEGIN @@ -142,16 +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 authorization UI coordinator that can present an authorization - 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 OIDAuthorizationFlowSession instance which will terminate when it - receives a @c OIDAuthorizationFlowSession.cancel message, or after processing a - @c OIDAuthorizationFlowSession.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 - UICoordinator:(id)UICoordinator + UICoordinator:(id)UICoordinator callback:(OIDAuthStateAuthorizationCallback)callback; /*! @internal diff --git a/Source/OIDAuthState.m b/Source/OIDAuthState.m index 57a47aa91..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, @@ -157,7 +157,7 @@ - (nonnull instancetype)init OID_UNAVAILABLE_USE_INITIALIZER(@selector(initWithAuthorizationResponse:tokenResponse:)); /*! @brief Creates an auth state from an authorization response. - @param response The authorization response. + @param authorizationResponse The authorization response. */ - (instancetype)initWithAuthorizationResponse:(OIDAuthorizationResponse *)authorizationResponse { return [self initWithAuthorizationResponse:authorizationResponse tokenResponse:nil]; @@ -165,7 +165,7 @@ - (instancetype)initWithAuthorizationResponse:(OIDAuthorizationResponse *)author /*! @brief Designated initializer. - @param response The authorization response. + @param authorizationResponse The authorization response. @discussion Creates an auth state from an authorization response and token response. */ - (instancetype)initWithAuthorizationResponse:(OIDAuthorizationResponse *)authorizationResponse diff --git a/Source/OIDAuthorizationRequest.h b/Source/OIDAuthorizationRequest.h index 971557ed9..2df78f4bd 100644 --- a/Source/OIDAuthorizationRequest.h +++ b/Source/OIDAuthorizationRequest.h @@ -22,6 +22,7 @@ // so they are imported here for convenience. #import "OIDResponseTypes.h" #import "OIDScopes.h" +#import "OIDExternalUserAgentRequest.h" @class OIDServiceConfiguration; @@ -37,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 3c00ecb78..73052b09d 100644 --- a/Source/OIDAuthorizationRequest.m +++ b/Source/OIDAuthorizationRequest.m @@ -329,4 +329,14 @@ - (NSURL *)authorizationRequestURL { return [query URLByReplacingQueryInURL:_configuration.authorizationEndpoint]; } +#pragma mark - OIDExternalUserAgentRequest + +- (NSURL *)externalUserAgentRequestURL { + return [self authorizationRequestURL]; +} + +- (NSString *)redirectScheme { + return [[self redirectURL] scheme]; +} + @end diff --git a/Source/OIDAuthorizationService.h b/Source/OIDAuthorizationService.h index fe80c0b41..bd1554c6f 100644 --- a/Source/OIDAuthorizationService.h +++ b/Source/OIDAuthorizationService.h @@ -26,8 +26,8 @@ @class OIDServiceConfiguration; @class OIDTokenRequest; @class OIDTokenResponse; -@protocol OIDAuthorizationFlowSession; -@protocol OIDAuthorizationUICoordinator; +@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 OIDAuthorizationFlowSession instance which will terminate when it - receives a @c OIDAuthorizationFlowSession.cancel message, or after processing a - @c OIDAuthorizationFlowSession.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) presentAuthorizationRequest:(OIDAuthorizationRequest *)request - UICoordinator:(id)UICoordinator + UICoordinator:(id)UICoordinator callback:(OIDAuthorizationCallback)callback; /*! @brief Performs a token request. @@ -139,38 +139,4 @@ typedef void (^OIDRegistrationCompletion)(OIDRegistrationResponse *_Nullable reg @end -/*! @brief Represents an in-flight authorization flow session. - */ -@protocol OIDAuthorizationFlowSession - -/*! @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 OIDAuthorizationFlowSession.resumeAuthorizationFlowWithURL: 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 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 OIDAuthorizationUICoordinator or clients 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 - NS_ASSUME_NONNULL_END diff --git a/Source/OIDAuthorizationService.m b/Source/OIDAuthorizationService.m index 061cff681..ea342d23b 100644 --- a/Source/OIDAuthorizationService.m +++ b/Source/OIDAuthorizationService.m @@ -20,7 +20,8 @@ #import "OIDAuthorizationRequest.h" #import "OIDAuthorizationResponse.h" -#import "OIDAuthorizationUICoordinator.h" +#import "OIDExternalUserAgentUICoordinator.h" +#import "OIDExternalUserAgentFlowSession.h" #import "OIDDefines.h" #import "OIDErrorUtilities.h" #import "OIDRegistrationRequest.h" @@ -40,10 +41,10 @@ NS_ASSUME_NONNULL_BEGIN -@interface OIDAuthorizationFlowSessionImplementation : NSObject { +@interface OIDAuthorizationFlowSessionImplementation : NSObject { // private variables OIDAuthorizationRequest *_request; - id _UICoordinator; + id _UICoordinator; OIDAuthorizationCallback _pendingauthorizationFlowCallback; } @@ -64,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 presentAuthorizationRequest:_request session:self]; + [_UICoordinator presentExternalUserAgentRequest:_request session:self]; if (!authorizationFlowStarted) { NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeSafariOpenError underlyingError:nil @@ -79,14 +80,13 @@ - (void)presentAuthorizationWithCoordinator:(id)U } - (void)cancel { - [_UICoordinator dismissAuthorizationAnimated: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 { @@ -101,7 +101,7 @@ - (BOOL)shouldHandleURL:(NSURL *)URL { OIDIsEqualIncludingNil(standardizedURL.path, standardizedRedirectURL.path); } -- (BOOL)resumeAuthorizationFlowWithURL:(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; @@ -145,15 +145,14 @@ - (BOOL)resumeAuthorizationFlowWithURL:(NSURL *)URL { } } - [_UICoordinator dismissAuthorizationAnimated:YES - completion:^{ - [self didFinishWithResponse:response error:error]; - }]; + [_UICoordinator dismissExternalUserAgentUIAnimated:YES completion:^{ + [self didFinishWithResponse:response error:error]; + }]; return YES; } -- (void)failAuthorizationFlowWithError:(NSError *)error { +- (void)failExternalUserAgentFlowWithError:(NSError *)error { [self didFinishWithResponse:nil error:error]; } @@ -245,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/OIDAuthorizationUICoordinator.h b/Source/OIDAuthorizationUICoordinator.h deleted file mode 100644 index d42d8c5f5..000000000 --- a/Source/OIDAuthorizationUICoordinator.h +++ /dev/null @@ -1,53 +0,0 @@ -/*! @file OIDAuthorizationUICoordinator.h - @brief AppAuth iOS SDK - @copyright - Copyright 2016 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. - */ - -#import - -@class OIDAuthorizationRequest; -@protocol OIDAuthorizationFlowSession; - -NS_ASSUME_NONNULL_BEGIN - -/*! @protocol OIDAuthorizationUICoordinator - @brief An authorization UI coordinator that presents an authorization request. Clients may - provide custom implementations of an authorization UI coordinator to customize the way the - authorization request is presented to the user. - */ -@protocol OIDAuthorizationUICoordinator - -/*! @brief Presents the authroization request in the user agent. - @param request The authorizatoin request to be presented in the user agent. - @param session The @c OIDAuthorizationFlowSession instance that initiates presenting the - authorization UI. Concrete implementations of a @c OIDAuthorizationUICoordinator may call - resumeAuthorizationFlowWithURL or failAuthorizationFlowWithError on session to either - resume or fail the authorization. - @return YES If the authorization UI was successfully presented to the user. - */ -- (BOOL)presentAuthorizationRequest:(OIDAuthorizationRequest *)request - session:(id)session; - -/*! @brief Dimisses the authorization 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 authorization UI is presented. - @param completion The block to be called when the dismiss operations ends - */ -- (void)dismissAuthorizationAnimated:(BOOL)animated completion:(void (^)(void))completion; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Source/OIDExternalUserAgentFlowSession.h b/Source/OIDExternalUserAgentFlowSession.h new file mode 100644 index 000000000..2123bd2ce --- /dev/null +++ b/Source/OIDExternalUserAgentFlowSession.h @@ -0,0 +1,52 @@ +/*! @file OIDExternalUserAgentFlowSession.h + @brief AppAuth iOS SDK + @copyright + Copyright 2017 The AppAuth Authors. 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 external user-agent flow session. + */ +@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 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 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 + \SFSafariViewController or loopback HTTP listener if those were used. The completion block + of the pending 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)resumeExternalUserAgentFlowWithURL:(NSURL *)URL; + +/*! @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)failExternalUserAgentFlowWithError:(NSError *)error; + +@end diff --git a/Source/OIDExternalUserAgentRequest.h b/Source/OIDExternalUserAgentRequest.h new file mode 100644 index 000000000..18cff8f45 --- /dev/null +++ b/Source/OIDExternalUserAgentRequest.h @@ -0,0 +1,37 @@ +/*! @file OIDExternalUserAgentUICoordinator.h + @brief AppAuth iOS SDK + @copyright + Copyright 2017 The AppAuth Authors. 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. + */ + +/*! @protocol OIDExternalUserAgentUICoordinator + @brief An interface that any external user-agent request may implement to use the + @c OIDExternalUserAgentUICoordinator flow. + */ +@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 an external UI (i.e. browser) + */ +- (NSURL*)externalUserAgentRequestURL; + +/*! @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. + */ +- (NSString*)redirectScheme; +@end diff --git a/Source/OIDExternalUserAgentUICoordinator.h b/Source/OIDExternalUserAgentUICoordinator.h new file mode 100644 index 000000000..1941e72b0 --- /dev/null +++ b/Source/OIDExternalUserAgentUICoordinator.h @@ -0,0 +1,53 @@ +/*! @file OIDExternalUserAgentUICoordinator.h + @brief AppAuth iOS SDK + @copyright + Copyright 2016 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. + */ + +#import + +@protocol OIDExternalUserAgentFlowSession; +@protocol OIDExternalUserAgentRequest; + +NS_ASSUME_NONNULL_BEGIN + +/*! @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 OIDExternalUserAgentUICoordinator + +/*! @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 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)presentExternalUserAgentRequest:(id )request + session:(id)session; + +/*! @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)dismissExternalUserAgentUIAnimated:(BOOL)animated completion:(void (^)(void))completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/iOS/OIDAuthState+IOS.h b/Source/iOS/OIDAuthState+IOS.h index 80f162587..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 OIDAuthorizationFlowSession instance which will terminate when it - receives a @c OIDAuthorizationFlowSession.cancel message, or after processing a - @c OIDAuthorizationFlowSession.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 3e32a8be9..0129524c2 100644 --- a/Source/iOS/OIDAuthState+IOS.m +++ b/Source/iOS/OIDAuthState+IOS.m @@ -18,15 +18,15 @@ #import "OIDAuthState+IOS.h" -#import "OIDAuthorizationUICoordinatorIOS.h" +#import "OIDExternalUserAgentUICoordinatorIOS.h" @implementation OIDAuthState (IOS) -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest presentingViewController:(UIViewController *)presentingViewController callback:(OIDAuthStateAuthorizationCallback)callback { - OIDAuthorizationUICoordinatorIOS *coordinator = [[OIDAuthorizationUICoordinatorIOS 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 3d76340e8..91ca35748 100644 --- a/Source/iOS/OIDAuthorizationService+IOS.h +++ b/Source/iOS/OIDAuthorizationService+IOS.h @@ -19,6 +19,7 @@ #import #import "OIDAuthorizationService.h" +#import "OIDExternalUserAgentFlowSession.h" NS_ASSUME_NONNULL_BEGIN @@ -31,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 OIDAuthorizationFlowSession instance which will terminate when it - receives a @c OIDAuthorizationFlowSession.cancel message, or after processing a - @c OIDAuthorizationFlowSession.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) presentAuthorizationRequest:(OIDAuthorizationRequest *)request presentingViewController:(UIViewController *)presentingViewController callback:(OIDAuthorizationCallback)callback; diff --git a/Source/iOS/OIDAuthorizationService+IOS.m b/Source/iOS/OIDAuthorizationService+IOS.m index 2a8d6da86..8e34b042c 100644 --- a/Source/iOS/OIDAuthorizationService+IOS.m +++ b/Source/iOS/OIDAuthorizationService+IOS.m @@ -18,17 +18,17 @@ #import "OIDAuthorizationService+IOS.h" -#import "OIDAuthorizationUICoordinatorIOS.h" +#import "OIDExternalUserAgentUICoordinatorIOS.h" NS_ASSUME_NONNULL_BEGIN @implementation OIDAuthorizationService (IOS) -+ (id) ++ (id) presentAuthorizationRequest:(OIDAuthorizationRequest *)request presentingViewController:(UIViewController *)presentingViewController callback:(OIDAuthorizationCallback)callback { - OIDAuthorizationUICoordinatorIOS *coordinator = [[OIDAuthorizationUICoordinatorIOS alloc] + OIDExternalUserAgentUICoordinatorIOS *coordinator = [[OIDExternalUserAgentUICoordinatorIOS alloc] initWithPresentingViewController:presentingViewController]; return [self presentAuthorizationRequest:request UICoordinator:coordinator callback:callback]; } diff --git a/Source/iOS/OIDAuthorizationUICoordinatorIOS.h b/Source/iOS/OIDExternalUserAgentUICoordinatorIOS.h similarity index 86% rename from Source/iOS/OIDAuthorizationUICoordinatorIOS.h rename to Source/iOS/OIDExternalUserAgentUICoordinatorIOS.h index 2e6295f24..aeddbddfa 100644 --- a/Source/iOS/OIDAuthorizationUICoordinatorIOS.h +++ b/Source/iOS/OIDExternalUserAgentUICoordinatorIOS.h @@ -1,4 +1,4 @@ -/*! @file OIDAuthorizationUICoordinator.h +/*! @file OIDExternalUserAgentUICoordinatorIOS.h @brief AppAuth iOS SDK @copyright Copyright 2016 Google Inc. All Rights Reserved. @@ -18,7 +18,7 @@ #import -#import "OIDAuthorizationUICoordinator.h" +#import "OIDExternalUserAgentUICoordinator.h" @class SFSafariViewController; @@ -36,10 +36,10 @@ NS_ASSUME_NONNULL_BEGIN @end -/*! @brief An iOS specific authorization UI Coordinator that uses a \SFSafariViewController to - present an authorization request. +/*! @brief An iOS specific external user-agent UI Coordinator that uses a \SFSafariViewController to + present an user-agent request. */ -@interface OIDAuthorizationUICoordinatorIOS : 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/OIDAuthorizationUICoordinatorIOS.m b/Source/iOS/OIDExternalUserAgentUICoordinatorIOS.m similarity index 82% rename from Source/iOS/OIDAuthorizationUICoordinatorIOS.m rename to Source/iOS/OIDExternalUserAgentUICoordinatorIOS.m index 70bd3104e..37ab4c87b 100644 --- a/Source/iOS/OIDAuthorizationUICoordinatorIOS.m +++ b/Source/iOS/OIDExternalUserAgentUICoordinatorIOS.m @@ -16,13 +16,13 @@ limitations under the License. */ -#import "OIDAuthorizationUICoordinatorIOS.h" +#import "OIDExternalUserAgentUICoordinatorIOS.h" #import -#import "OIDAuthorizationRequest.h" -#import "OIDAuthorizationService.h" #import "OIDErrorUtilities.h" +#import "OIDExternalUserAgentRequest.h" +#import "OIDExternalUserAgentFlowSession.h" NS_ASSUME_NONNULL_BEGIN @@ -37,14 +37,14 @@ @interface OIDDefaultSafariViewControllerFactory : NSObject @end -@interface OIDAuthorizationUICoordinatorIOS () +@interface OIDExternalUserAgentUICoordinatorIOS () @end -@implementation OIDAuthorizationUICoordinatorIOS { +@implementation OIDExternalUserAgentUICoordinatorIOS { UIViewController *_presentingViewController; - BOOL _authorizationFlowInProgress; - __weak id _session; + BOOL _externalUserAgentFlowInProgress; + __weak id _session; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpartial-availability" __weak SFSafariViewController *_safariVC; @@ -76,20 +76,20 @@ - (nullable instancetype)initWithPresentingViewController: return self; } -- (BOOL)presentAuthorizationRequest:(OIDAuthorizationRequest *)request - session:(id)session { - if (_authorizationFlowInProgress) { +- (BOOL)presentExternalUserAgentRequest:(id)request + session:(id)session { + if (_externalUserAgentFlowInProgress) { // TODO: Handle errors as authorization is already in progress. return NO; } - _authorizationFlowInProgress = YES; + _externalUserAgentFlowInProgress = YES; _session = session; BOOL openedSafari = NO; - NSURL *requestURL = [request authorizationRequestURL]; + NSURL *requestURL = [request externalUserAgentRequestURL]; if (@available(iOS 11.0, *)) { - NSString *redirectScheme = request.redirectURL.scheme; + NSString *redirectScheme = request.redirectScheme; SFAuthenticationSession* authenticationVC = [[SFAuthenticationSession alloc] initWithURL:requestURL callbackURLScheme:redirectScheme @@ -97,13 +97,13 @@ - (BOOL)presentAuthorizationRequest:(OIDAuthorizationRequest *)request NSError * _Nullable error) { _authenticationVC = nil; if (callbackURL) { - [_session resumeAuthorizationFlowWithURL:callbackURL]; + [_session resumeExternalUserAgentFlowWithURL:callbackURL]; } else { NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeUserCanceledAuthorizationFlow underlyingError:error description:nil]; - [_session failAuthorizationFlowWithError:safariError]; + [_session failExternalUserAgentFlowWithError:safariError]; } }]; _authenticationVC = authenticationVC; @@ -124,13 +124,13 @@ - (BOOL)presentAuthorizationRequest:(OIDAuthorizationRequest *)request NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeSafariOpenError underlyingError:nil description:@"Unable to open Safari."]; - [session failAuthorizationFlowWithError:safariError]; + [session failExternalUserAgentFlowWithError:safariError]; } return openedSafari; } -- (void)dismissAuthorizationAnimated:(BOOL)animated completion:(void (^)(void))completion { - if (!_authorizationFlowInProgress) { +- (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; - _authorizationFlowInProgress = 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 (!_authorizationFlowInProgress) { + 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 failAuthorizationFlowWithError:error]; + [session failExternalUserAgentFlowWithError:error]; } @end diff --git a/Source/macOS/OIDAuthState+Mac.h b/Source/macOS/OIDAuthState+Mac.h index ddb6e377f..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 OIDAuthorizationFlowSession instance which will terminate when it - receives a @c OIDAuthorizationFlowSession.cancel message, or after processing a - @c OIDAuthorizationFlowSession.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 callback:(OIDAuthStateAuthorizationCallback)callback; @end diff --git a/Source/macOS/OIDAuthState+Mac.m b/Source/macOS/OIDAuthState+Mac.m index 02f367b6d..8ec007f9b 100644 --- a/Source/macOS/OIDAuthState+Mac.m +++ b/Source/macOS/OIDAuthState+Mac.m @@ -18,14 +18,14 @@ #import "OIDAuthState+Mac.h" -#import "OIDAuthorizationUICoordinatorMac.h" +#import "OIDExternalUserAgentUICoordinatorMac.h" @implementation OIDAuthState (Mac) -+ (id) ++ (id) authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest callback:(OIDAuthStateAuthorizationCallback)callback { - OIDAuthorizationUICoordinatorMac *coordinator = [[OIDAuthorizationUICoordinatorMac 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 c8c98c15d..556f79024 100644 --- a/Source/macOS/OIDAuthorizationService+Mac.h +++ b/Source/macOS/OIDAuthorizationService+Mac.h @@ -27,12 +27,12 @@ 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 OIDAuthorizationFlowSession instance which will terminate when it - receives a @c OIDAuthorizationFlowSession.cancel message, or after processing a - @c OIDAuthorizationFlowSession.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)presentAuthorizationRequest:(OIDAuthorizationRequest *)request - callback:(OIDAuthorizationCallback)callback; ++ (id)presentAuthorizationRequest:(OIDAuthorizationRequest *)request + callback:(OIDAuthorizationCallback)callback; @end NS_ASSUME_NONNULL_END diff --git a/Source/macOS/OIDAuthorizationService+Mac.m b/Source/macOS/OIDAuthorizationService+Mac.m index d1b138a12..cd8fa9124 100644 --- a/Source/macOS/OIDAuthorizationService+Mac.m +++ b/Source/macOS/OIDAuthorizationService+Mac.m @@ -18,15 +18,15 @@ #import "OIDAuthorizationService+Mac.h" -#import "OIDAuthorizationUICoordinatorMac.h" +#import "OIDExternalUserAgentUICoordinatorMac.h" NS_ASSUME_NONNULL_BEGIN @implementation OIDAuthorizationService (Mac) -+ (id)presentAuthorizationRequest:(OIDAuthorizationRequest *)request - callback:(OIDAuthorizationCallback)callback { - OIDAuthorizationUICoordinatorMac *coordinator = [[OIDAuthorizationUICoordinatorMac alloc] init]; ++ (id)presentAuthorizationRequest:(OIDAuthorizationRequest *)request + callback:(OIDAuthorizationCallback)callback { + OIDExternalUserAgentUICoordinatorMac *coordinator = [[OIDExternalUserAgentUICoordinatorMac alloc] init]; return [self presentAuthorizationRequest:request UICoordinator:coordinator callback:callback]; } diff --git a/Source/macOS/OIDAuthorizationUICoordinatorMac.h b/Source/macOS/OIDExternalUserAgentUICoordinatorMac.h similarity index 66% rename from Source/macOS/OIDAuthorizationUICoordinatorMac.h rename to Source/macOS/OIDExternalUserAgentUICoordinatorMac.h index 06f0a3422..81c747111 100644 --- a/Source/macOS/OIDAuthorizationUICoordinatorMac.h +++ b/Source/macOS/OIDExternalUserAgentUICoordinatorMac.h @@ -1,4 +1,4 @@ -/*! @file OIDAuthorizationUICoordinatorMac.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 "OIDAuthorizationUICoordinator.h" +#import "OIDExternalUserAgentUICoordinator.h" NS_ASSUME_NONNULL_BEGIN -/*! @brief An Mac specific authorization UI Coordinator that uses the default browser to - present an authorization request. +/*! @brief A Mac-specific external user-agent UI Coordinator that uses the default browser to + present a request. */ -@interface OIDAuthorizationUICoordinatorMac : NSObject { +@interface OIDExternalUserAgentUICoordinatorMac : NSObject { // private variables - BOOL _authorizationFlowInProgress; - __weak id _session; + BOOL _externalUserAgentFlowInProgress; + __weak id _session; } @end diff --git a/Source/macOS/OIDAuthorizationUICoordinatorMac.m b/Source/macOS/OIDExternalUserAgentUICoordinatorMac.m similarity index 67% rename from Source/macOS/OIDAuthorizationUICoordinatorMac.m rename to Source/macOS/OIDExternalUserAgentUICoordinatorMac.m index 165d34694..d27979920 100644 --- a/Source/macOS/OIDAuthorizationUICoordinatorMac.m +++ b/Source/macOS/OIDExternalUserAgentUICoordinatorMac.m @@ -1,4 +1,4 @@ -/*! @file OIDAuthorizationUICoordinatorMac.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 "OIDAuthorizationUICoordinatorMac.h" +#import "OIDExternalUserAgentUICoordinatorMac.h" #import -#import "OIDAuthorizationRequest.h" -#import "OIDAuthorizationService.h" #import "OIDErrorUtilities.h" +#import "OIDExternalUserAgentRequest.h" +#import "OIDExternalUserAgentFlowSession.h" NS_ASSUME_NONNULL_BEGIN -@implementation OIDAuthorizationUICoordinatorMac +@implementation OIDExternalUserAgentUICoordinatorMac -- (BOOL)presentAuthorizationRequest:(OIDAuthorizationRequest *)request - session:(id)session { - if (_authorizationFlowInProgress) { +- (BOOL)presentExternalUserAgentRequest:(id)request + session:(id)session { + if (_externalUserAgentFlowInProgress) { // TODO: Handle errors as authorization is already in progress. return NO; } - _authorizationFlowInProgress = YES; + _externalUserAgentFlowInProgress = YES; _session = session; - NSURL *requestURL = [request authorizationRequestURL]; + NSURL *requestURL = [request externalUserAgentRequestURL]; BOOL openedBrowser = [[NSWorkspace sharedWorkspace] openURL:requestURL]; if (!openedBrowser) { @@ -45,13 +45,13 @@ - (BOOL)presentAuthorizationRequest:(OIDAuthorizationRequest *)request NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeBrowserOpenError underlyingError:nil description:@"Unable to open the browser."]; - [session failAuthorizationFlowWithError:safariError]; + [session failExternalUserAgentFlowWithError:safariError]; } return openedBrowser; } -- (void)dismissAuthorizationAnimated:(BOOL)animated completion:(void (^)(void))completion { - if (!_authorizationFlowInProgress) { +- (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)dismissAuthorizationAnimated:(BOOL)animated completion:(void (^)(void))c - (void)cleanUp { _session = nil; - _authorizationFlowInProgress = NO; + _externalUserAgentFlowInProgress = NO; } @end diff --git a/Source/macOS/OIDRedirectHTTPHandler.h b/Source/macOS/OIDRedirectHTTPHandler.h index f445ebbea..9a7c3b21d 100644 --- a/Source/macOS/OIDRedirectHTTPHandler.h +++ b/Source/macOS/OIDRedirectHTTPHandler.h @@ -21,54 +21,55 @@ NS_ASSUME_NONNULL_BEGIN @class HTTPServer; -@protocol OIDAuthorizationFlowSession; +@protocol OIDExternalUserAgentFlowSession; -/*! @brief Start a HTTP server on the loopback interface (i.e. @c 127.0.0.1) to receive OAuth - authorization response redirects on macOS. +/*! @brief Start a HTTP server on the loopback interface (i.e. @c 127.0.0.1) to receive the OAuth + response redirects on macOS. */ @interface OIDRedirectHTTPHandler : NSObject { // private variables HTTPServer *_httpServ; NSURL *_successURL; // property variables - NSObject *_currentAuthorizationFlow; + NSObject *_currentExternalUserAgentFlow; } -/*! @brief The authorization 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 an authorization 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 currentAuthorizationFlow; +@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 authorization flow completes + @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 authorization request, be sure to set - @c currentAuthorizationFlow on this object so that any authorization responses received by - this listener will be routed accordingly. + @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 an @c OIDAuthorizationRequest, - and once you initiate the request, set the resulting @c OIDAuthorizationFlowSession to - @c currentAuthorizationFlow 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 - authorization response. Calling this more than once will result in the previous listener - being cancelled (equivalent of @c cancelHTTPListener being called). + @discussion Each instance of @c OIDRedirectHTTPHandler can only listen for a single response. + Calling this more than once will result in the previous listener being cancelled (equivalent + of @c cancelHTTPListener being called). */ - (NSURL *)startHTTPListener:(NSError **)error; /*! @brief Stops listening the loopback interface and sends an cancellation error (in the domain ::OIDGeneralErrorDomain, with the code ::OIDErrorCodeProgramCanceledAuthorizationFlow) to - the @c currentAuthorizationFlow. Has no effect if called when no requests are pending. - @discussion The HTTP listener is stopped automatically on receiving a valid authorization - response (regardless of whether the authorization succeeded or not), this method should not - be called except when abandoning the authorization request. + 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 external user-agent request. */ - (void)cancelHTTPListener; diff --git a/Source/macOS/OIDRedirectHTTPHandler.m b/Source/macOS/OIDRedirectHTTPHandler.m index 3003de02f..b67be5749 100644 --- a/Source/macOS/OIDRedirectHTTPHandler.m +++ b/Source/macOS/OIDRedirectHTTPHandler.m @@ -21,6 +21,7 @@ #import "OIDAuthorizationService.h" #import "OIDErrorUtilities.h" #import "OIDLoopbackHTTPServer.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. @@ -48,7 +49,7 @@ @implementation OIDRedirectHTTPHandler -@synthesize currentAuthorizationFlow = _currentAuthorizationFlow; +@synthesize currentExternalUserAgentFlow = _currentExternalUserAgentFlow; - (instancetype)init { return [self initWithSuccessURL:nil]; @@ -97,8 +98,8 @@ - (void)cancelHTTPListener { [OIDErrorUtilities errorWithCode:OIDErrorCodeProgramCanceledAuthorizationFlow underlyingError:nil description:@"The HTTP listener was cancelled programmatically."]; - [_currentAuthorizationFlow failAuthorizationFlowWithError:cancelledError]; - _currentAuthorizationFlow = nil; + [_currentExternalUserAgentFlow failExternalUserAgentFlowWithError:cancelledError]; + _currentExternalUserAgentFlow = nil; } /*! @brief Stops listening on the loopback interface without modifying the state of the @@ -114,11 +115,11 @@ - (void)stopHTTPListener { - (void)HTTPConnection:(HTTPConnection *)conn didReceiveRequest:(HTTPServerRequest *)mess { // Sends URL to AppAuth. CFURLRef url = CFHTTPMessageCopyRequestURL(mess.request); - BOOL handled = [_currentAuthorizationFlow resumeAuthorizationFlowWithURL:(__bridge NSURL *)url]; + BOOL handled = [_currentExternalUserAgentFlow resumeExternalUserAgentFlowWithURL:(__bridge NSURL *)url]; // Stops listening to further requests after the first valid authorization response. if (handled) { - _currentAuthorizationFlow = nil; + _currentExternalUserAgentFlow = nil; [self stopHTTPListener]; } @@ -127,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 (_currentAuthorizationFlow) { + if (_currentExternalUserAgentFlow) { bodyText = kHTMLErrorRedirectNotValid; httpResponseCode = 404; } else {