From d5a6924deaa64d63ee7e940c3f5c0e8e540d3721 Mon Sep 17 00:00:00 2001 From: Vahan Harutyunyan Date: Tue, 3 Oct 2023 18:42:23 -0400 Subject: [PATCH 1/2] Improve unit tests, move hard coded URLs to one place, change test url --- .../FRURLProtocol/FRURLProtocolTests.swift | 24 +++++++++---------- .../Policy/AuthorizationPolicyTests.swift | 2 +- .../FRAuth/SSL Pinning/SSLPinningTests.swift | 8 +++---- .../FRSecurityConfigurationTests.swift | 7 +++--- .../FRCore/Network/RequestTests.swift | 4 ++-- .../FRCore/Network/RestClientTests.swift | 4 ++-- .../RequestInterceptorTests.swift | 20 ++++++++-------- .../xcschemes/FRTestHost.xcscheme | 8 ------- .../FRTestHost/FRAuthConfigPKHash.plist | 2 +- .../BaseTest/FRBaseTestCase.swift | 11 ++++++++- 10 files changed, 46 insertions(+), 44 deletions(-) diff --git a/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/FRURLProtocol/FRURLProtocolTests.swift b/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/FRURLProtocol/FRURLProtocolTests.swift index fbb2b9ca..112604f4 100644 --- a/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/FRURLProtocol/FRURLProtocolTests.swift +++ b/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/FRURLProtocol/FRURLProtocolTests.swift @@ -2,7 +2,7 @@ // FRURLProtocolTests.swift // FRAuthTests // -// Copyright (c) 2020 ForgeRock. All rights reserved. +// Copyright (c) 2020-2023 ForgeRock. All rights reserved. // // This software may be modified and distributed under the terms // of the MIT license. See the LICENSE file for details. @@ -52,7 +52,7 @@ class FRURLProtocolTests: FRAuthBaseTest { // When let ex = self.expectation(description: "Making request") - urlSession.dataTask(with: URL(string: "https://httpbin.org/anything")!) { (data, response, error) in + urlSession.dataTask(with: URL(string: FRTestURL.anythingURL)!) { (data, response, error) in let response = Response(data: data, response: response, error: error).parseReponse() // Authorization header should have not been sent @@ -92,13 +92,13 @@ class FRURLProtocolTests: FRAuthBaseTest { let urlSession: URLSession = URLSession(configuration: config) // Set TokenManagementPolicy, but with different URL for validation - let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: "https://httpbin.org/any")!], delegate: nil) + let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: FRTestURL.anythingURL)!], delegate: nil) FRURLProtocol.authorizationPolicy = nil FRURLProtocol.tokenManagementPolicy = tokenManagementPolicy // When let ex = self.expectation(description: "Making request") - urlSession.dataTask(with: URL(string: "https://httpbin.org/anything")!) { (data, response, error) in + urlSession.dataTask(with: URL(string: FRTestURL.anythingURL)!) { (data, response, error) in let response = Response(data: data, response: response, error: error).parseReponse() // Authorization header should have not been sent @@ -137,13 +137,13 @@ class FRURLProtocolTests: FRAuthBaseTest { let urlSession: URLSession = URLSession(configuration: config) // Set TokenManagementPolicy without delegate for default Authorization header, and validating URL - let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: "https://httpbin.org/anything")!], delegate: nil) + let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: FRTestURL.anythingURL)!], delegate: nil) FRURLProtocol.authorizationPolicy = nil FRURLProtocol.tokenManagementPolicy = tokenManagementPolicy // When let ex = self.expectation(description: "Making request") - urlSession.dataTask(with: URL(string: "https://httpbin.org/anything")!) { (data, response, error) in + urlSession.dataTask(with: URL(string: FRTestURL.anythingURL)!) { (data, response, error) in let response = Response(data: data, response: response, error: error).parseReponse() // Authorization header should have been sent @@ -183,13 +183,13 @@ class FRURLProtocolTests: FRAuthBaseTest { let urlSession: URLSession = URLSession(configuration: config) // Set TokenManagementPolicy with delegate, and let delegation method to update request - let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: "https://httpbin.org/anything")!], delegate: self) + let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: FRTestURL.anythingURL)!], delegate: self) FRURLProtocol.authorizationPolicy = nil FRURLProtocol.tokenManagementPolicy = tokenManagementPolicy // When let ex = self.expectation(description: "Making request") - urlSession.dataTask(with: URL(string: "https://httpbin.org/anything")!) { (data, response, error) in + urlSession.dataTask(with: URL(string: FRTestURL.anythingURL)!) { (data, response, error) in let response = Response(data: data, response: response, error: error).parseReponse() // Authorization header should have been sent with customized header name in delegation method @@ -233,13 +233,13 @@ class FRURLProtocolTests: FRAuthBaseTest { // Set TokenManagementPolicy with delegate, and let delegation method to update request self.evaluateTokenRefresh = true - let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: "https://httpbin.org/anything")!], delegate: self) + let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: FRTestURL.anythingURL)!], delegate: self) FRURLProtocol.authorizationPolicy = nil FRURLProtocol.tokenManagementPolicy = tokenManagementPolicy // When let ex = self.expectation(description: "Making request") - urlSession.dataTask(with: URL(string: "https://httpbin.org/anything")!) { (data, response, error) in + urlSession.dataTask(with: URL(string: FRTestURL.anythingURL)!) { (data, response, error) in let response = Response(data: data, response: response, error: error).parseReponse() // Authorization header should have been sent with customized header name in delegation method @@ -293,13 +293,13 @@ class FRURLProtocolTests: FRAuthBaseTest { let urlSession: URLSession = URLSession(configuration: config) // Set TokenManagementPolicy with delegate, and let delegation method to handle evaluation for 401 status code - let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: "https://httpbin.org/status/401")!], delegate: self) + let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: FRTestURL.status401URL)!], delegate: self) FRURLProtocol.authorizationPolicy = nil FRURLProtocol.tokenManagementPolicy = tokenManagementPolicy // When let ex = self.expectation(description: "Making request") - urlSession.dataTask(with: URL(string: "https://httpbin.org/status/401")!) { (data, response, error) in + urlSession.dataTask(with: URL(string: FRTestURL.status401URL)!) { (data, response, error) in let response = Response(data: data, response: response, error: error).parseReponse() // Request must fail with status code 401, even though evaluationRefreshToken policy satsifies, it must receive 401 if it keeps failing diff --git a/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/Policy/AuthorizationPolicyTests.swift b/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/Policy/AuthorizationPolicyTests.swift index e9f75167..5fa6e032 100644 --- a/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/Policy/AuthorizationPolicyTests.swift +++ b/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/Policy/AuthorizationPolicyTests.swift @@ -221,7 +221,7 @@ class AuthorizationPolicyTests: FRAuthBaseTest { let policy = AuthorizationPolicy(validatingURL: [URL(string: "https://openam.example.com/anything")!], delegate: self) self.policyAdvice = PolicyAdvice(type: "TransactionConditionAdvice", value: "5afff42a-2715-40c8-98e7-919abc1b2dfc") let session = URLSession(configuration: .default) - let task = session.dataTask(with: URL(string: "https://httpbin.org/anything")!) + let task = session.dataTask(with: URL(string: FRTestURL.anythingURL)!) let advice = policy.evaluateAuthorizationPolicyWithRedirect(responseData: nil, session: URLSession(), task: task, willPerformHTTPRedirection: HTTPURLResponse(), newRequest: URLRequest(url: URL(string: "https://www.forgerock.com")!)) XCTAssertEqual(advice, self.policyAdvice) XCTAssertEqual(self.list.count, 1) diff --git a/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/SSL Pinning/SSLPinningTests.swift b/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/SSL Pinning/SSLPinningTests.swift index 1e3b11a8..cd2e1029 100644 --- a/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/SSL Pinning/SSLPinningTests.swift +++ b/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/SSL Pinning/SSLPinningTests.swift @@ -2,7 +2,7 @@ // SSLPinningTests.swift // FRAuthTests // -// Copyright (c) 2022 ForgeRock. All rights reserved. +// Copyright (c) 2022-2023 ForgeRock. All rights reserved. // // This software may be modified and distributed under the terms // of the MIT license. See the LICENSE file for details. @@ -27,7 +27,7 @@ class SSLPinningTests: FRAuthBaseTest { // Init SDK self.startSDK() - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) let ex = self.expectation(description: "Request submit") var requestSucceeded = false @@ -57,7 +57,7 @@ class SSLPinningTests: FRAuthBaseTest { // Init SDK self.startSDK() - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) let ex = self.expectation(description: "Request submit") var requestSucceeded = false @@ -117,7 +117,7 @@ class SSLPinningTests: FRAuthBaseTest { // Init SDK self.startSDK() - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) let ex = self.expectation(description: "Request submit") var requestSucceeded = false diff --git a/FRCore/FRCoreTests/FRCore/Network/FRSecurityConfigurationTests.swift b/FRCore/FRCoreTests/FRCore/Network/FRSecurityConfigurationTests.swift index 76ce7f77..12887974 100644 --- a/FRCore/FRCoreTests/FRCore/Network/FRSecurityConfigurationTests.swift +++ b/FRCore/FRCoreTests/FRCore/Network/FRSecurityConfigurationTests.swift @@ -2,7 +2,7 @@ // FRSecurityConfigurationTests.swift // FRCoreTests // -// Copyright (c) 2022 ForgeRock. All rights reserved. +// Copyright (c) 2022-2023 ForgeRock. All rights reserved. // // This software may be modified and distributed under the terms // of the MIT license. See the LICENSE file for details. @@ -40,7 +40,7 @@ class FRSecurityConfigurationTests: FRBaseTestCase { //Validate with the correct public key hash let frSecurityConfiguration1 = FRSecurityConfiguration(hashes: ["+KSzREQbAh9gqYLLGpfCG+cAy7Px3/Qmk/e8Egwyd7o="]) - let validated1 = frSecurityConfiguration1.validate(serverTrust: trust, domain: "https://httpbin.org/") + let validated1 = frSecurityConfiguration1.validate(serverTrust: trust, domain: FRTestURL.baseURL) XCTAssertTrue(validated1, "Certificate failed to validate with the correct public key hash") @@ -66,7 +66,8 @@ class FRSecurityConfigurationTests: FRBaseTestCase { //Validate with a wrong public key hash let frSecurityConfiguration2 = FRSecurityConfiguration(hashes: ["GSHJImFNL2AkwaL7xE1K+LVGj/V4Dgl7QYrNHKF5g0U="]) - let validated2 = frSecurityConfiguration2.validate(serverTrust: trust, domain: "https://httpbin.org/") + let validated2 = frSecurityConfiguration2.validate(serverTrust: trust, domain: FRTestURL.baseURL + ) XCTAssertFalse(validated2, "Certificate successfully validated with a wrong public key hash") } diff --git a/FRCore/FRCoreTests/FRCore/Network/RequestTests.swift b/FRCore/FRCoreTests/FRCore/Network/RequestTests.swift index 4a16c7ac..31d42054 100644 --- a/FRCore/FRCoreTests/FRCore/Network/RequestTests.swift +++ b/FRCore/FRCoreTests/FRCore/Network/RequestTests.swift @@ -2,7 +2,7 @@ // RequestTest.swift // FRCoreTests // -// Copyright (c) 2020 ForgeRock. All rights reserved. +// Copyright (c) 2020-2023 ForgeRock. All rights reserved. // // This software may be modified and distributed under the terms // of the MIT license. See the LICENSE file for details. @@ -12,7 +12,7 @@ import XCTest class RequestTests: FRBaseTestCase { - let testURL: String = "https://httpbin.org" + let testURL: String = FRTestURL.baseURL /// Tests basic initialization method with valid URL string func testBasicConstruction() { diff --git a/FRCore/FRCoreTests/FRCore/Network/RestClientTests.swift b/FRCore/FRCoreTests/FRCore/Network/RestClientTests.swift index 2fd2288c..bfa96b87 100644 --- a/FRCore/FRCoreTests/FRCore/Network/RestClientTests.swift +++ b/FRCore/FRCoreTests/FRCore/Network/RestClientTests.swift @@ -59,7 +59,7 @@ class RestClientTests: FRBaseTestCase { func test_02_test_200_get_request() { - let request = Request(url: "https://httpbin.org/get", method: .GET) + let request = Request(url: FRTestURL.getURL, method: .GET) let expectation = self.expectation(description: "GET request: \(request.debugDescription)") var response:[String: Any]?, urlResponse: URLResponse?, error: NetworkError? @@ -88,7 +88,7 @@ class RestClientTests: FRBaseTestCase { func test_03_test_invalid_response_image() { - let request = Request(url: "https://httpbin.org/image", method: .GET, headers: ["accept":"image/webp"]) + let request = Request(url: FRTestURL.imageURL, method: .GET, headers: ["accept":"image/webp"]) let expectation = self.expectation(description: "GET request: \(request.debugDescription)") var response:[String: Any]?, urlResponse: URLResponse?, error: NetworkError? diff --git a/FRCore/FRCoreTests/FRCore/RequestInterceptor/RequestInterceptorTests.swift b/FRCore/FRCoreTests/FRCore/RequestInterceptor/RequestInterceptorTests.swift index 27c4d717..4dd4eed1 100644 --- a/FRCore/FRCoreTests/FRCore/RequestInterceptor/RequestInterceptorTests.swift +++ b/FRCore/FRCoreTests/FRCore/RequestInterceptor/RequestInterceptorTests.swift @@ -2,7 +2,7 @@ // RequestInterceptorTests.swift // FRCoreTests // -// Copyright (c) 2020 ForgeRock. All rights reserved. +// Copyright (c) 2020-2023 ForgeRock. All rights reserved. // // This software may be modified and distributed under the terms // of the MIT license. See the LICENSE file for details. @@ -36,7 +36,7 @@ class RequestInterceptorTests: FRBaseTestCase { func test_01_request_captured_and_processed_interceptor() { - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) RequestInterceptorRegistry.shared.registerInterceptors(interceptors: [StartAuthenticateInterceptor()]) let ex = self.expectation(description: "Request submit") RestClient.shared.invoke(request: request, action: Action(type: .START_AUTHENTICATE)) { (result) in @@ -66,7 +66,7 @@ class RequestInterceptorTests: FRBaseTestCase { func test_02_request_captured_and_should_not_process_interceptor_for_different_action() { - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) RequestInterceptorRegistry.shared.registerInterceptors(interceptors: [StartAuthenticateInterceptor()]) let ex = self.expectation(description: "Request submit") RestClient.shared.invoke(request: request, action: Action(type: .AUTHORIZE)) { (result) in @@ -96,7 +96,7 @@ class RequestInterceptorTests: FRBaseTestCase { func test_03_request_captured_and_should_process_interceptors_in_order() { - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) RequestInterceptorRegistry.shared.registerInterceptors(interceptors: [DummyOne(), DummyTwo(), DummyThree(), DummyFour()]) let ex = self.expectation(description: "Request submit") RestClient.shared.invoke(request: request, action: Action(type: .AUTHORIZE)) { (result) in @@ -132,7 +132,7 @@ class RequestInterceptorTests: FRBaseTestCase { func test_04_request_captured_and_should_not_process_interceptor_for_different_action_sync() { - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) RequestInterceptorRegistry.shared.registerInterceptors(interceptors: [StartAuthenticateInterceptor()]) let _ = RestClient.shared.invokeSync(request: request, action: Action(type: .AUTHORIZE)) @@ -152,7 +152,7 @@ class RequestInterceptorTests: FRBaseTestCase { func test_05_request_captured_and_should_process_interceptors_in_order_sync() { - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) RequestInterceptorRegistry.shared.registerInterceptors(interceptors: [DummyOne(), DummyTwo(), DummyThree(), DummyFour()]) let _ = RestClient.shared.invokeSync(request: request, action: Action(type: .AUTHORIZE)) @@ -177,7 +177,7 @@ class RequestInterceptorTests: FRBaseTestCase { func test_06_request_not_captured_when_no_action_defined() { - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) RequestInterceptorRegistry.shared.registerInterceptors(interceptors: [DummyOne(), DummyTwo(), DummyThree(), DummyFour()]) let ex = self.expectation(description: "Request submit") RestClient.shared.invoke(request: request) { (result) in @@ -211,7 +211,7 @@ class RequestInterceptorTests: FRBaseTestCase { func test_07_request_captured_and_invoke_different_url() { - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) RequestInterceptorRegistry.shared.registerInterceptors(interceptors: [DifferentURLInterceptor()]) let ex = self.expectation(description: "Request submit") RestClient.shared.invoke(request: request, action: Action(type: .AUTHENTICATE)) { (result) in @@ -241,7 +241,7 @@ class RequestInterceptorTests: FRBaseTestCase { func test_08_request_captured_in_seuqence_and_get_updated_request() { - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) RequestInterceptorRegistry.shared.registerInterceptors(interceptors: [InterceptorSequenceOne(), InterceptorSequenceTwo(), InterceptorSequenceThree()]) let ex = self.expectation(description: "Request submit") RestClient.shared.invoke(request: request, action: Action(type: .AUTHENTICATE)) { (result) in @@ -275,7 +275,7 @@ class RequestInterceptorTests: FRBaseTestCase { func test_09_action_with_payload() { - let request = Request(url: "https://httpbin.org/anything", method: .GET) + let request = Request(url: FRTestURL.anythingURL, method: .GET) RequestInterceptorRegistry.shared.registerInterceptors(interceptors: [PayloadInterceptor()]) let ex = self.expectation(description: "Request submit") RestClient.shared.invoke(request: request, action: Action(type: .AUTHENTICATE, payload: ["testKey":"testVal"])) { (result) in diff --git a/FRTestHost/FRTestHost.xcodeproj/xcshareddata/xcschemes/FRTestHost.xcscheme b/FRTestHost/FRTestHost.xcodeproj/xcshareddata/xcschemes/FRTestHost.xcscheme index 0a74c2db..f5a93677 100644 --- a/FRTestHost/FRTestHost.xcodeproj/xcshareddata/xcschemes/FRTestHost.xcscheme +++ b/FRTestHost/FRTestHost.xcodeproj/xcshareddata/xcschemes/FRTestHost.xcscheme @@ -187,14 +187,6 @@ BlueprintName = "FRAuthTests" ReferencedContainer = "container:../FRAuth/FRAuth.xcodeproj"> - - - - - - diff --git a/FRTestHost/FRTestHost/FRAuthConfigPKHash.plist b/FRTestHost/FRTestHost/FRAuthConfigPKHash.plist index 90461b5b..1b67a46b 100644 --- a/FRTestHost/FRTestHost/FRAuthConfigPKHash.plist +++ b/FRTestHost/FRTestHost/FRAuthConfigPKHash.plist @@ -26,7 +26,7 @@ signUp forgerock_ssl_pinning_public_key_hashes - j5bzD/UjYVE+0feXsngcrVs3i1vSaoOOtPgpLBb9Db8= + L99AfCC6OWHAzUYG+bSYsZa+rlEawO1lye134280lfU= diff --git a/FRTestHost/FRTestHost/SharedTestFiles/BaseTest/FRBaseTestCase.swift b/FRTestHost/FRTestHost/SharedTestFiles/BaseTest/FRBaseTestCase.swift index f0c6b4b1..cf0e5f3f 100644 --- a/FRTestHost/FRTestHost/SharedTestFiles/BaseTest/FRBaseTestCase.swift +++ b/FRTestHost/FRTestHost/SharedTestFiles/BaseTest/FRBaseTestCase.swift @@ -2,7 +2,7 @@ // FRBaseTestCase.swift // FRAuthTests // -// Copyright (c) 2020-2021 ForgeRock. All rights reserved. +// Copyright (c) 2020-2023 ForgeRock. All rights reserved. // // This software may be modified and distributed under the terms // of the MIT license. See the LICENSE file for details. @@ -156,3 +156,12 @@ class InternalRequestInterceptor: RequestInterceptor { return request } } + +public enum FRTestURL { + static let baseURL = "https://httpbingo.org" + static let imageURL = baseURL + "/image" + static let anythingURL = baseURL + "/anything" + static let getURL = baseURL + "/get" + static let status401URL = baseURL + "/status/401" +} + From 3a9f975a648ef9ff4fe75ba1f8cd91a67b563f42 Mon Sep 17 00:00:00 2001 From: Stoyan Petrov Date: Tue, 5 Dec 2023 18:35:08 -0800 Subject: [PATCH 2/2] Updated AM hostname for device binding tests Updated hostname and public key hash for certificate pinning tests --- .../Callback-Live/AA-05-DeviceBindingCallbackTest.swift | 2 +- .../Callback-Live/AA-06-DeviceSigningVerifierCallbackTest.swift | 2 +- .../FRAuth/FRURLProtocol/FRURLProtocolTests.swift | 2 +- FRTestHost/FRTestHost/FRAuthConfigPKHash.plist | 2 +- .../FRTestHost/SharedTestFiles/BaseTest/FRBaseTestCase.swift | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FRAuth/FRAuthTests/FRAuthSwiftTests/E2ETests/Callback-Live/AA-05-DeviceBindingCallbackTest.swift b/FRAuth/FRAuthTests/FRAuthSwiftTests/E2ETests/Callback-Live/AA-05-DeviceBindingCallbackTest.swift index d465665b..b74c4907 100644 --- a/FRAuth/FRAuthTests/FRAuthSwiftTests/E2ETests/Callback-Live/AA-05-DeviceBindingCallbackTest.swift +++ b/FRAuth/FRAuthTests/FRAuthSwiftTests/E2ETests/Callback-Live/AA-05-DeviceBindingCallbackTest.swift @@ -15,7 +15,7 @@ import XCTest class AA_05_DeviceBindingCallbackTest: CallbackBaseTest { static var USERNAME: String = "sdkuser" - let options = FROptions(url: "https://openam-dbind.forgeblocks.com/am", + let options = FROptions(url: "https://openam-sdks.forgeblocks.com/am", realm: "alpha", enableCookie: true, cookieName: "afef1acb448a873", diff --git a/FRAuth/FRAuthTests/FRAuthSwiftTests/E2ETests/Callback-Live/AA-06-DeviceSigningVerifierCallbackTest.swift b/FRAuth/FRAuthTests/FRAuthSwiftTests/E2ETests/Callback-Live/AA-06-DeviceSigningVerifierCallbackTest.swift index 49f2cd95..3667fe65 100644 --- a/FRAuth/FRAuthTests/FRAuthSwiftTests/E2ETests/Callback-Live/AA-06-DeviceSigningVerifierCallbackTest.swift +++ b/FRAuth/FRAuthTests/FRAuthSwiftTests/E2ETests/Callback-Live/AA-06-DeviceSigningVerifierCallbackTest.swift @@ -17,7 +17,7 @@ class AA_06_DeviceSigningVerifierCallbackTest: CallbackBaseTest { static var USERNAME: String = "sdkuser" static var APPLICATION_PIN: String = "1111" - let options = FROptions(url: "https://openam-dbind.forgeblocks.com/am", + let options = FROptions(url: "https://openam-sdks.forgeblocks.com/am", realm: "alpha", enableCookie: true, cookieName: "afef1acb448a873", diff --git a/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/FRURLProtocol/FRURLProtocolTests.swift b/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/FRURLProtocol/FRURLProtocolTests.swift index 112604f4..3ce2cbbb 100644 --- a/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/FRURLProtocol/FRURLProtocolTests.swift +++ b/FRAuth/FRAuthTests/FRAuthSwiftTests/FRAuth/FRURLProtocol/FRURLProtocolTests.swift @@ -92,7 +92,7 @@ class FRURLProtocolTests: FRAuthBaseTest { let urlSession: URLSession = URLSession(configuration: config) // Set TokenManagementPolicy, but with different URL for validation - let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: FRTestURL.anythingURL)!], delegate: nil) + let tokenManagementPolicy = TokenManagementPolicy(validatingURL: [URL(string: "\(FRTestURL.baseURL)/any")!], delegate: nil) FRURLProtocol.authorizationPolicy = nil FRURLProtocol.tokenManagementPolicy = tokenManagementPolicy diff --git a/FRTestHost/FRTestHost/FRAuthConfigPKHash.plist b/FRTestHost/FRTestHost/FRAuthConfigPKHash.plist index 1b67a46b..72ecca7d 100644 --- a/FRTestHost/FRTestHost/FRAuthConfigPKHash.plist +++ b/FRTestHost/FRTestHost/FRAuthConfigPKHash.plist @@ -26,7 +26,7 @@ signUp forgerock_ssl_pinning_public_key_hashes - L99AfCC6OWHAzUYG+bSYsZa+rlEawO1lye134280lfU= + xuycWePFSVzZILxPmRYEM5D3KEnTExjc5n4BjsYBX0I= diff --git a/FRTestHost/FRTestHost/SharedTestFiles/BaseTest/FRBaseTestCase.swift b/FRTestHost/FRTestHost/SharedTestFiles/BaseTest/FRBaseTestCase.swift index cf0e5f3f..406025d8 100644 --- a/FRTestHost/FRTestHost/SharedTestFiles/BaseTest/FRBaseTestCase.swift +++ b/FRTestHost/FRTestHost/SharedTestFiles/BaseTest/FRBaseTestCase.swift @@ -158,7 +158,7 @@ class InternalRequestInterceptor: RequestInterceptor { } public enum FRTestURL { - static let baseURL = "https://httpbingo.org" + static let baseURL = "https://httpbin.org" static let imageURL = baseURL + "/image" static let anythingURL = baseURL + "/anything" static let getURL = baseURL + "/get"