diff --git a/AppAuth.xcodeproj/project.pbxproj b/AppAuth.xcodeproj/project.pbxproj index 5f424427b..5d2d45fac 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, ); }; }; @@ -341,9 +334,9 @@ 343AAB9B1E834A8800F9D36E /* AppAuth.h in Headers */ = {isa = PBXBuildFile; fileRef = 343AAA4D1E8345B600F9D36E /* AppAuth.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB9C1E834A8900F9D36E /* AppAuth.h in Headers */ = {isa = PBXBuildFile; fileRef = 343AAA4D1E8345B600F9D36E /* AppAuth.h */; settings = {ATTRIBUTES = (Public, ); }; }; 343AAB9D1E834A8A00F9D36E /* AppAuth.h in Headers */ = {isa = PBXBuildFile; fileRef = 343AAA4D1E8345B600F9D36E /* AppAuth.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 345AE747202D526900738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 345AE745202D526800738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.m */; }; - 345AE748202D526900738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 345AE745202D526800738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.m */; }; - 345AE749202D526900738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.h in Headers */ = {isa = PBXBuildFile; fileRef = 345AE746202D526800738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 345AE747202D526900738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 345AE745202D526800738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.m */; }; + 345AE748202D526900738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 345AE745202D526800738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.m */; }; + 345AE749202D526900738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.h in Headers */ = {isa = PBXBuildFile; fileRef = 345AE746202D526800738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 347423E41E7F3C4000D3E6D6 /* OIDAuthorizationResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 341741B71C5D8243000EF209 /* OIDAuthorizationResponse.m */; }; 347423FF1E7F4BA000D3E6D6 /* OIDAuthorizationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 341741B51C5D8243000EF209 /* OIDAuthorizationRequest.m */; }; 347424001E7F4BA000D3E6D6 /* OIDAuthorizationResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 341741B71C5D8243000EF209 /* OIDAuthorizationResponse.m */; }; @@ -380,6 +373,25 @@ 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 */; }; + A6339DAA20321ADD0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6339DAB20321AE50043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6339DAC20321AE70043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6339DAD20321AEB0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6DEAB9B2018E4AD0022AC32 /* 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 */ @@ -463,8 +475,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; }; @@ -545,8 +557,8 @@ 343AAAAE1E83489A00F9D36E /* AppAuth_tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppAuth_tvOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 343AAAC21E8348A900F9D36E /* AppAuth.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AppAuth.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 343AAACA1E8348AA00F9D36E /* AppAuth_macOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppAuth_macOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 345AE745202D526800738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OIDAuthorizationUICoordinatorCustomBrowser.m; path = iOS/OIDAuthorizationUICoordinatorCustomBrowser.m; sourceTree = ""; }; - 345AE746202D526800738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OIDAuthorizationUICoordinatorCustomBrowser.h; path = iOS/OIDAuthorizationUICoordinatorCustomBrowser.h; sourceTree = ""; }; + 345AE745202D526800738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OIDExternalUserAgentUICoordinatorCustomBrowser.m; path = iOS/OIDExternalUserAgentUICoordinatorCustomBrowser.m; sourceTree = ""; }; + 345AE746202D526800738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OIDExternalUserAgentUICoordinatorCustomBrowser.h; path = iOS/OIDExternalUserAgentUICoordinatorCustomBrowser.h; sourceTree = ""; }; 347423F61E7F4B5600D3E6D6 /* libAppAuth-watchOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libAppAuth-watchOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 34D5EC431E6D1AD900814354 /* OIDAppAuthTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OIDAppAuthTests-Bridging-Header.h"; sourceTree = ""; }; 34D5EC441E6D1AD900814354 /* OIDSwiftTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OIDSwiftTests.swift; sourceTree = ""; }; @@ -562,12 +574,15 @@ 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 = ""; }; + A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDAuthorizationFlowSession.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 */ @@ -689,8 +704,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 */, ); @@ -735,13 +750,13 @@ 340DAE241D581FE700EC285B /* macOS */, F6F60FAF1D2BFEF000325CB3 /* iOS */, 341741AF1C5D8243000EF209 /* AppAuth.h */, + A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */, 341741B41C5D8243000EF209 /* OIDAuthorizationRequest.h */, 341741B51C5D8243000EF209 /* OIDAuthorizationRequest.m */, 341741B61C5D8243000EF209 /* OIDAuthorizationResponse.h */, 341741B71C5D8243000EF209 /* OIDAuthorizationResponse.m */, 341741B81C5D8243000EF209 /* OIDAuthorizationService.h */, 341741B91C5D8243000EF209 /* OIDAuthorizationService.m */, - F68103B61D2568D10053658E /* OIDAuthorizationUICoordinator.h */, 341741BA1C5D8243000EF209 /* OIDAuthState.h */, 341741BB1C5D8243000EF209 /* OIDAuthState.m */, 341741BC1C5D8243000EF209 /* OIDAuthStateChangeDelegate.h */, @@ -753,6 +768,9 @@ 341741C01C5D8243000EF209 /* OIDError.m */, 341741C11C5D8243000EF209 /* OIDErrorUtilities.h */, 341741C21C5D8243000EF209 /* OIDErrorUtilities.m */, + A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentFlowSession.h */, + A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */, + A6DEAB982018E4A20022AC32 /* OIDExternalUserAgentUICoordinator.h */, 341741C31C5D8243000EF209 /* OIDFieldMapping.h */, 341741C41C5D8243000EF209 /* OIDFieldMapping.m */, 60140F7E1DE4335200DA0DC3 /* OIDRegistrationResponse.h */, @@ -852,12 +870,12 @@ children = ( F6F60FB31D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.h */, F6F60FB11D2BFEFE00325CB3 /* OIDAuthorizationService+IOS.m */, - 345AE746202D526800738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.h */, - 345AE745202D526800738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.m */, + 345AE746202D526800738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.h */, + 345AE745202D526800738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.m */, F6F60FB51D2BFEFE00325CB3 /* OIDAuthState+IOS.h */, F6F60FB01D2BFEFE00325CB3 /* OIDAuthState+IOS.m */, - F6F60FB41D2BFEFE00325CB3 /* OIDAuthorizationUICoordinatorIOS.h */, - F6F60FB21D2BFEFE00325CB3 /* OIDAuthorizationUICoordinatorIOS.m */, + A6DEABA92018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.h */, + A6DEABA82018E5B50022AC32 /* OIDExternalUserAgentUICoordinatorIOS.m */, ); name = iOS; sourceTree = ""; @@ -880,10 +898,10 @@ files = ( 343AAAE41E83499000F9D36E /* OIDAuthorizationResponse.h in Headers */, 343AAAF31E83499000F9D36E /* OIDScopes.h in Headers */, + A6DEAB9F2018E4B00022AC32 /* OIDExternalUserAgentRequest.h in Headers */, 343AAAE81E83499000F9D36E /* OIDAuthStateChangeDelegate.h in Headers */, - 345AE749202D526900738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.h in Headers */, + 345AE749202D526900738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.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 */, @@ -892,17 +910,20 @@ 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 */, + A6339DAA20321ADD0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -913,13 +934,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 */, @@ -927,8 +951,8 @@ 343AAB101E83499100F9D36E /* OIDTokenResponse.h in Headers */, 343AAAFC1E83499100F9D36E /* OIDAuthorizationResponse.h in Headers */, 343AAB0C1E83499100F9D36E /* OIDScopeUtilities.h in Headers */, + A6339DAB20321AE50043D1C9 /* OIDAuthorizationFlowSession.h in Headers */, 343AAB011E83499100F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, - 343AAAFE1E83499100F9D36E /* OIDAuthorizationUICoordinator.h in Headers */, 343AAAFB1E83499100F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAB051E83499100F9D36E /* OIDErrorUtilities.h in Headers */, ); @@ -941,13 +965,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 */, @@ -955,8 +982,8 @@ 343AAB281E83499200F9D36E /* OIDTokenResponse.h in Headers */, 343AAB141E83499200F9D36E /* OIDAuthorizationResponse.h in Headers */, 343AAB241E83499200F9D36E /* OIDScopeUtilities.h in Headers */, + A6339DAC20321AE70043D1C9 /* OIDAuthorizationFlowSession.h in Headers */, 343AAB191E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, - 343AAB161E83499200F9D36E /* OIDAuthorizationUICoordinator.h in Headers */, 343AAB131E83499200F9D36E /* OIDAuthorizationRequest.h in Headers */, 343AAB1D1E83499200F9D36E /* OIDErrorUtilities.h in Headers */, ); @@ -967,12 +994,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 */, @@ -986,9 +1015,10 @@ 343AAAE11E83494A00F9D36E /* OIDLoopbackHTTPServer.h in Headers */, 343AAB311E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */, 343AAB2F1E83499200F9D36E /* OIDAuthState.h in Headers */, + A6339DAD20321AEB0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */, 343AAB3E1E83499200F9D36E /* OIDServiceDiscovery.h in Headers */, + A6DEAB9E2018E4AE0022AC32 /* 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 */, @@ -1437,7 +1467,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 */, @@ -1452,6 +1482,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 */, @@ -1465,8 +1496,7 @@ 60140F7A1DE4276800DA0DC3 /* OIDClientMetadataParameters.m in Sources */, 341741DE1C5D8243000EF209 /* OIDAuthState.m in Sources */, 341741DD1C5D8243000EF209 /* OIDAuthorizationService.m in Sources */, - 345AE747202D526900738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.m in Sources */, - 340DAECD1D582DE100EC285B /* OIDAuthorizationUICoordinatorIOS.m in Sources */, + 345AE747202D526900738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.m in Sources */, 341741EB1C5D8243000EF209 /* OIDURLQueryComponent.m in Sources */, 341741E11C5D8243000EF209 /* OIDFieldMapping.m in Sources */, 039697461FA8258D003D1FB2 /* OIDURLSessionProvider.m in Sources */, @@ -1575,12 +1605,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 */, @@ -1588,7 +1618,7 @@ 343AAA931E83478900F9D36E /* OIDTokenUtilities.m in Sources */, 343AAA901E83478900F9D36E /* OIDServiceDiscovery.m in Sources */, 343AAA911E83478900F9D36E /* OIDTokenRequest.m in Sources */, - 345AE748202D526900738D22 /* OIDAuthorizationUICoordinatorCustomBrowser.m in Sources */, + 345AE748202D526900738D22 /* OIDExternalUserAgentUICoordinatorCustomBrowser.m in Sources */, 343AAA6F1E83467D00F9D36E /* OIDAuthorizationService+IOS.m in Sources */, 343AAA8F1E83478900F9D36E /* OIDServiceConfiguration.m in Sources */, 343AAA891E83478900F9D36E /* OIDRegistrationResponse.m in Sources */, @@ -1724,7 +1754,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 fae50153f..6abddd3f0 100644 --- a/Source/AppAuth.h +++ b/Source/AppAuth.h @@ -17,14 +17,16 @@ */ #import "OIDAuthState.h" +#import "OIDAuthorizationFlowSession.h" #import "OIDAuthStateChangeDelegate.h" #import "OIDAuthStateErrorDelegate.h" #import "OIDAuthorizationRequest.h" #import "OIDAuthorizationResponse.h" #import "OIDAuthorizationService.h" -#import "OIDAuthorizationUICoordinator.h" #import "OIDError.h" #import "OIDErrorUtilities.h" +#import "OIDExternalUserAgentFlowSession.h" +#import "OIDExternalUserAgentUICoordinator.h" #import "OIDGrantTypes.h" #import "OIDRegistrationRequest.h" #import "OIDRegistrationResponse.h" @@ -43,12 +45,11 @@ #elif TARGET_OS_IOS #import "OIDAuthState+IOS.h" #import "OIDAuthorizationService+IOS.h" -#import "OIDAuthorizationUICoordinatorCustomBrowser.h" -#import "OIDAuthorizationUICoordinatorIOS.h" +#import "OIDExternalUserAgentUICoordinatorCustomBrowser.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 c5a3ca26b..4891f31bb 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,12 +50,12 @@ FOUNDATION_EXPORT const unsigned char AppAuthVersionString[]; #elif TARGET_OS_IOS #import #import -#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..c45c5a32b 100644 --- a/Source/OIDAuthState.h +++ b/Source/OIDAuthState.h @@ -24,9 +24,10 @@ @class OIDTokenResponse; @class OIDTokenRequest; @protocol OIDAuthorizationFlowSession; -@protocol OIDAuthorizationUICoordinator; @protocol OIDAuthStateChangeDelegate; @protocol OIDAuthStateErrorDelegate; +@protocol OIDExternalUserAgentUICoordinator; +@protocol OIDExternalUserAgentFlowSession; NS_ASSUME_NONNULL_BEGIN @@ -142,16 +143,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..c2832b5d1 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/OIDAuthorizationFlowSession.h b/Source/OIDAuthorizationFlowSession.h new file mode 100644 index 000000000..0201e3520 --- /dev/null +++ b/Source/OIDAuthorizationFlowSession.h @@ -0,0 +1,42 @@ +/*! @file OIDAuthorizationRequest.h + @brief AppAuth iOS SDK + @copyright + Copyright 2015 Google Inc. All Rights Reserved. + @copydetails + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +/*! @brief Represents an in-flight authorization flow session. + */ +@protocol OIDAuthorizationFlowSession + +/*! @brief Clients should call this method with the result of the authorization code flow if it + becomes available. + @param URL The redirect URL invoked by the authorization server. + @discussion When the URL represented a valid authorization response, implementations + should clean up any left-over UI state from the authorization, for example by + closing the \SFSafariViewController or looback HTTP listener if those were used. + The completion block of the pending authorization request should then be invoked. + @remarks Has no effect if called more than once, or after a @c cancel message was received. + @return YES if the passed URL matches the expected redirect URL and was consumed, NO otherwise. + */ +- (BOOL)resumeAuthorizationFlowWithURL:(NSURL *)URL; + +/*! @brief @c 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 diff --git a/Source/OIDAuthorizationRequest.h b/Source/OIDAuthorizationRequest.h index 971557ed9..c9611ea15 100644 --- a/Source/OIDAuthorizationRequest.h +++ b/Source/OIDAuthorizationRequest.h @@ -20,6 +20,7 @@ // These files only declare string constants useful for constructing a @c OIDAuthorizationRequest, // so they are imported here for convenience. +#import "OIDExternalUserAgentRequest.h" #import "OIDResponseTypes.h" #import "OIDScopes.h" @@ -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..6bf8f3418 100644 --- a/Source/OIDAuthorizationService.h +++ b/Source/OIDAuthorizationService.h @@ -27,7 +27,8 @@ @class OIDTokenRequest; @class OIDTokenResponse; @protocol OIDAuthorizationFlowSession; -@protocol OIDAuthorizationUICoordinator; +@protocol OIDExternalUserAgentFlowSession; +@protocol OIDExternalUserAgentUICoordinator; NS_ASSUME_NONNULL_BEGIN @@ -115,13 +116,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 +140,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..9ee53f6b7 100644 --- a/Source/OIDAuthorizationService.m +++ b/Source/OIDAuthorizationService.m @@ -20,9 +20,11 @@ #import "OIDAuthorizationRequest.h" #import "OIDAuthorizationResponse.h" -#import "OIDAuthorizationUICoordinator.h" #import "OIDDefines.h" #import "OIDErrorUtilities.h" +#import "OIDAuthorizationFlowSession.h" +#import "OIDExternalUserAgentFlowSession.h" +#import "OIDExternalUserAgentUICoordinator.h" #import "OIDRegistrationRequest.h" #import "OIDRegistrationResponse.h" #import "OIDServiceConfiguration.h" @@ -40,10 +42,10 @@ NS_ASSUME_NONNULL_BEGIN -@interface OIDAuthorizationFlowSessionImplementation : NSObject { +@interface OIDAuthorizationFlowSessionImplementation : NSObject { // private variables OIDAuthorizationRequest *_request; - id _UICoordinator; + id _UICoordinator; OIDAuthorizationCallback _pendingauthorizationFlowCallback; } @@ -64,12 +66,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 +81,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 +102,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 +146,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]; } @@ -171,6 +171,14 @@ - (void)didFinishWithResponse:(nullable OIDAuthorizationResponse *)response } } +- (void)failAuthorizationFlowWithError:(NSError *)error { + [self failAuthorizationFlowWithError:error]; +} + +- (BOOL)resumeAuthorizationFlowWithURL:(NSURL *)URL { + return [self resumeExternalUserAgentFlowWithURL:URL]; +} + @end @implementation OIDAuthorizationService @@ -245,9 +253,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..a55fab2c7 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..01e60c21e 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..fc81a4460 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..42fd7dfcc 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/OIDAuthorizationUICoordinatorCustomBrowser.h b/Source/iOS/OIDExternalUserAgentUICoordinatorCustomBrowser.h similarity index 78% rename from Source/iOS/OIDAuthorizationUICoordinatorCustomBrowser.h rename to Source/iOS/OIDExternalUserAgentUICoordinatorCustomBrowser.h index 1eedb2f21..09493daf8 100644 --- a/Source/iOS/OIDAuthorizationUICoordinatorCustomBrowser.h +++ b/Source/iOS/OIDExternalUserAgentUICoordinatorCustomBrowser.h @@ -1,4 +1,4 @@ -/*! @file OIDAuthorizationUICoordinatorCustomBrowser.h +/*! @file OIDExternalUserAgentUICoordinatorCustomBrowser.h @brief AppAuth iOS SDK @copyright Copyright 2018 Google LLC @@ -18,7 +18,7 @@ #import -#import "OIDAuthorizationUICoordinator.h" +#import "OIDExternalUserAgentUICoordinator.h" NS_ASSUME_NONNULL_BEGIN @@ -29,13 +29,13 @@ NS_ASSUME_NONNULL_BEGIN */ typedef NSURL *_Nullable (^OIDCustomBrowserURLTransformation)(NSURL *_Nullable requestURL); -/*! @brief An implementation of the OIDAuthorizationUICoordinator protocol for iOS that uses - a custom browser (i.e. not Safari) for authorization. It is suitable for browsers that +/*! @brief An implementation of the OIDExternalUserAgentUICoordinator protocol for iOS that uses + a custom browser (i.e. not Safari) for external requests. It is suitable for browsers that offer a custom url scheme that simply replaces the "https" scheme. It is not designed for browsers that require other modifications to the URL. If the browser is not installed the user will be prompted to install it. */ -@interface OIDAuthorizationUICoordinatorCustomBrowser : NSObject +@interface OIDExternalUserAgentUICoordinatorCustomBrowser : NSObject /*! @brief URL transformation block for the browser. */ @@ -49,19 +49,19 @@ typedef NSURL *_Nullable (^OIDCustomBrowserURLTransformation)(NSURL *_Nullable r */ @property(nonatomic, readonly, nullable) NSURL *appStoreURL; -/*! @brief An instance of @c OIDAuthorizationUICoordinatorCustomBrowser for Chrome. +/*! @brief An instance of @c OIDExternalUserAgentUICoordinatorCustomBrowser for Chrome. */ + (instancetype)CustomBrowserChrome; -/*! @brief An instance of @c OIDAuthorizationUICoordinatorCustomBrowser for Firefox. +/*! @brief An instance of @c OIDExternalUserAgentUICoordinatorCustomBrowser for Firefox. */ + (instancetype)CustomBrowserFirefox; -/*! @brief An instance of @c OIDAuthorizationUICoordinatorCustomBrowser for Opera. +/*! @brief An instance of @c OIDExternalUserAgentUICoordinatorCustomBrowser for Opera. */ + (instancetype)CustomBrowserOpera; -/*! @brief An instance of @c OIDAuthorizationUICoordinatorCustomBrowser for Safari. +/*! @brief An instance of @c OIDExternalUserAgentUICoordinatorCustomBrowser for Safari. */ + (instancetype)CustomBrowserSafari; @@ -82,7 +82,7 @@ typedef NSURL *_Nullable (^OIDCustomBrowserURLTransformation)(NSURL *_Nullable r */ - (nonnull instancetype)init NS_UNAVAILABLE; -/*! @brief UICoordinator for a custom browser. @c presentAuthorizationRequest:session method +/*! @brief UICoordinator for a custom browser. @c presentExternalUserAgentRequest:session method will return NO if the browser isn't installed. */ - (nullable instancetype)initWithURLTransformation:(OIDCustomBrowserURLTransformation)URLTransformation; @@ -93,7 +93,7 @@ typedef NSURL *_Nullable (^OIDCustomBrowserURLTransformation)(NSURL *_Nullable r @param canOpenURLScheme any scheme supported by the browser used to check if the browser is installed. @param appStoreURL URL of the browser in the app store. When this and @c canOpenURLScheme - are non-nil, @c presentAuthorizationRequest:session will redirect the user to the app store + are non-nil, @c presentExternalUserAgentRequest:session will redirect the user to the app store if the browser is not installed. */ - (nullable instancetype)initWithURLTransformation:(OIDCustomBrowserURLTransformation)URLTransformation diff --git a/Source/iOS/OIDAuthorizationUICoordinatorCustomBrowser.m b/Source/iOS/OIDExternalUserAgentUICoordinatorCustomBrowser.m similarity index 91% rename from Source/iOS/OIDAuthorizationUICoordinatorCustomBrowser.m rename to Source/iOS/OIDExternalUserAgentUICoordinatorCustomBrowser.m index cba8dfe79..2285305da 100644 --- a/Source/iOS/OIDAuthorizationUICoordinatorCustomBrowser.m +++ b/Source/iOS/OIDExternalUserAgentUICoordinatorCustomBrowser.m @@ -1,4 +1,4 @@ -/*! @file OIDAuthorizationUICoordinatorCustomBrowser.m +/*! @file OIDExternalUserAgentUICoordinatorCustomBrowser.m @brief AppAuth iOS SDK @copyright Copyright 2018 Google LLC @@ -16,7 +16,7 @@ limitations under the License. */ -#import "OIDAuthorizationUICoordinatorCustomBrowser.h" +#import "OIDExternalUserAgentUICoordinatorCustomBrowser.h" #import @@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN -@implementation OIDAuthorizationUICoordinatorCustomBrowser { +@implementation OIDExternalUserAgentUICoordinatorCustomBrowser { OIDCustomBrowserURLTransformation _URLTransformation; NSString *_canOpenURLScheme; NSURL *_appStoreURL; @@ -72,7 +72,7 @@ + (instancetype)CustomBrowserSafari { OIDCustomBrowserURLTransformation transformNOP = ^NSURL *(NSURL *requestURL) { return requestURL; }; - OIDAuthorizationUICoordinatorCustomBrowser *coordinator = + OIDExternalUserAgentUICoordinatorCustomBrowser *coordinator = [[[self class] alloc] initWithURLTransformation:transformNOP]; return coordinator; } @@ -132,8 +132,8 @@ - (nullable instancetype)initWithURLTransformation: return self; } -- (BOOL)presentAuthorizationRequest:(OIDAuthorizationRequest *)request - session:(id)session { +- (BOOL)presentExternalUserAgentRequest:(nonnull id)request + session:(nonnull id)session { // If the app store URL is set, checks if the app is installed and if not opens the app store. if (_appStoreURL && _canOpenURLScheme) { // Verifies existence of LSApplicationQueriesSchemes Info.plist key. @@ -153,13 +153,14 @@ - (BOOL)presentAuthorizationRequest:(OIDAuthorizationRequest *)request } // Transforms the request URL and opens it. - NSURL *requestURL = [request authorizationRequestURL]; + NSURL *requestURL = [request externalUserAgentRequestURL]; requestURL = _URLTransformation(requestURL); BOOL openedInBrowser = [[UIApplication sharedApplication] openURL:requestURL]; return openedInBrowser; } -- (void)dismissAuthorizationAnimated:(BOOL)animated completion:(nonnull void (^)(void))completion { +- (void)dismissExternalUserAgentUIAnimated:(BOOL)animated + completion:(nonnull void (^)(void))completion { completion(); } 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..12149065a 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 "OIDExternalUserAgentFlowSession.h" +#import "OIDExternalUserAgentRequest.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..4103a75a5 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..6e7562ca9 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..ce4cf9569 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..c7dd2076f 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..99cb645ca 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 "OIDExternalUserAgentFlowSession.h" +#import "OIDExternalUserAgentRequest.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..59212fb9c 100644 --- a/Source/macOS/OIDRedirectHTTPHandler.h +++ b/Source/macOS/OIDRedirectHTTPHandler.h @@ -22,53 +22,56 @@ 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 *_currentAuthorizationFlow; } -/*! @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 currentAuthorizationFlow; /*! @brief Creates an a loopback HTTP redirect URI handler with the given success URL. - @param successURL The URL that the user is redirected to after the 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..4b284e69b 100644 --- a/Source/macOS/OIDRedirectHTTPHandler.m +++ b/Source/macOS/OIDRedirectHTTPHandler.m @@ -18,8 +18,10 @@ #import "OIDRedirectHTTPHandler.h" +#import "OIDAuthorizationFlowSession.h" #import "OIDAuthorizationService.h" #import "OIDErrorUtilities.h" +#import "OIDExternalUserAgentFlowSession.h" #import "OIDLoopbackHTTPServer.h" /*! @brief Page that is returned following a completed authorization. Show your own page instead by @@ -97,7 +99,7 @@ - (void)cancelHTTPListener { [OIDErrorUtilities errorWithCode:OIDErrorCodeProgramCanceledAuthorizationFlow underlyingError:nil description:@"The HTTP listener was cancelled programmatically."]; - [_currentAuthorizationFlow failAuthorizationFlowWithError:cancelledError]; + [_currentAuthorizationFlow failExternalUserAgentFlowWithError:cancelledError]; _currentAuthorizationFlow = nil; } @@ -114,7 +116,7 @@ - (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 = [_currentAuthorizationFlow resumeExternalUserAgentFlowWithURL:(__bridge NSURL *)url]; // Stops listening to further requests after the first valid authorization response. if (handled) { diff --git a/UnitTests/OIDAuthorizationRequestTests.m b/UnitTests/OIDAuthorizationRequestTests.m index 4a4af75af..9486440be 100644 --- a/UnitTests/OIDAuthorizationRequestTests.m +++ b/UnitTests/OIDAuthorizationRequestTests.m @@ -471,4 +471,10 @@ - (void)testSupportedResponseTypes { } +- (void)testExternalUserAgentMethods { + OIDAuthorizationRequest *request = [[self class] testInstance]; + XCTAssertEqualObjects([request externalUserAgentRequestURL], [request authorizationRequestURL]); + XCTAssert([[request redirectScheme] isEqualToString:request.redirectURL.scheme]); +} + @end