Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions FirebaseAuth/Sources/Swift/Auth/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,29 @@
}
#endif

// MARK: IDP Initiated SAML Sign In

public func signInWithSamlIdp(ProviderId providerId: String,
SpAcsUrl SpAcsUrl: String,

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, macOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, macOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, tvOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, tvOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, catalyst)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, catalyst)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, iOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, iOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, visionOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, visionOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, watchOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, watchOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (iOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label

Check warning on line 2347 in FirebaseAuth/Sources/Swift/Auth/Auth.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (iOS)

extraneous duplicate parameter name; 'SpAcsUrl' already has an argument label
SamlResp samlResp: String) async throws -> AuthDataResult {
let samlRespBody = "SAMLResponse=\(samlResp)&providerId=\(providerId)"
let request = SignInWithSamlIdpRequest(
requestUri: SpAcsUrl,
postBody: samlRespBody,
returnSecureToken: true,
requestConfiguration: requestConfiguration
)
let response = try await backend.call(with: request)
let user = try await completeSignIn(
withAccessToken: response.idToken,
accessTokenExpirationDate: response.expirationDate,
refreshToken: response.refreshToken,
anonymous: false
)
try await updateCurrentUser(user)
return AuthDataResult(withUser: user, additionalUserInfo: nil)
}

// MARK: Internal properties

/// Allow tests to swap in an alternate mainBundle, including ObjC unit tests via CocoaPods.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2025 Google LLC
//
// 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 Foundation

final class SignInWithSamlIdpRequest: AuthRPCRequest {
typealias Response = SignInWithSamlIdpResponse
private let config: AuthRequestConfiguration
private let requestUri: String
private let postBody: String
private let returnSecureToken: Bool

init(requestUri: String,
postBody: String,
returnSecureToken: Bool,
requestConfiguration: AuthRequestConfiguration) {
self.requestUri = requestUri
self.postBody = postBody
self.returnSecureToken = returnSecureToken
config = requestConfiguration
}

func requestConfiguration() -> AuthRequestConfiguration {
return config
}

func requestURL() -> URL {
var comps = URLComponents()
comps.scheme = "https"
comps.host = "identitytoolkit.googleapis.com"
comps.path = "/v1/accounts:signInWithIdp"
comps.queryItems = [URLQueryItem(name: "key", value: config.apiKey)]
return comps.url!
}

var unencodedHTTPRequestBody: [String: AnyHashable]? {
var body: [String: AnyHashable] = [

Check warning on line 48 in FirebaseAuth/Sources/Swift/Backend/RPC/SignInWithSamlIdpRequest.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, macOS)

variable 'body' was never mutated; consider changing to 'let' constant

Check warning on line 48 in FirebaseAuth/Sources/Swift/Backend/RPC/SignInWithSamlIdpRequest.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, tvOS)

variable 'body' was never mutated; consider changing to 'let' constant

Check warning on line 48 in FirebaseAuth/Sources/Swift/Backend/RPC/SignInWithSamlIdpRequest.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, catalyst)

variable 'body' was never mutated; consider changing to 'let' constant

Check warning on line 48 in FirebaseAuth/Sources/Swift/Backend/RPC/SignInWithSamlIdpRequest.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

variable 'body' was never mutated; consider changing to 'let' constant

Check warning on line 48 in FirebaseAuth/Sources/Swift/Backend/RPC/SignInWithSamlIdpRequest.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, iOS)

variable 'body' was never mutated; consider changing to 'let' constant

Check warning on line 48 in FirebaseAuth/Sources/Swift/Backend/RPC/SignInWithSamlIdpRequest.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, visionOS)

variable 'body' was never mutated; consider changing to 'let' constant

Check warning on line 48 in FirebaseAuth/Sources/Swift/Backend/RPC/SignInWithSamlIdpRequest.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, watchOS)

variable 'body' was never mutated; consider changing to 'let' constant

Check warning on line 48 in FirebaseAuth/Sources/Swift/Backend/RPC/SignInWithSamlIdpRequest.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (iOS)

variable 'body' was never mutated; consider changing to 'let' constant
"requestUri": requestUri,
"postBody": postBody,
"returnSecureToken": returnSecureToken,
]
return body
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2025 Google LLC
//
// 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 Foundation

struct SignInWithSamlIdpResponse: AuthRPCResponse {
/// The user raw access token.
let idToken: String
/// Refresh token for the authenticated user.
let refreshToken: String
/// The provider Identifier
let providerId: String
/// The email id of user
let email: String
/// The calculated date and time when the token expires.
let expirationDate: Date

init(dictionary: [String: AnyHashable]) throws {
guard
let email = dictionary["email"] as? String,
let expiration = dictionary["expiresIn"] as? String,
let idToken = dictionary["idToken"] as? String,
let providerId = dictionary["providerId"] as? String,
let refreshToken = dictionary["refreshToken"] as? String
else {
throw AuthErrorUtils.unexpectedResponse(deserializedResponse: dictionary)
}
self.idToken = idToken
self.refreshToken = refreshToken
self.providerId = providerId
self.email = email
let expiresInSec = TimeInterval(expiration)
expirationDate = Date().addingTimeInterval(expiresInSec ?? 3600)
}
}
146 changes: 146 additions & 0 deletions FirebaseAuth/Tests/Unit/AuthTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
return try self.rpcIssuer.respond(withJSON: ["signinMethods": allSignInMethods])
}

auth?.fetchSignInMethods(forEmail: kEmail) { signInMethods, error in

Check warning on line 90 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, macOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 90 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, tvOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 90 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, catalyst)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 90 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 90 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, iOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 90 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, visionOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 90 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, watchOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.
// 4. After the response triggers the callback, verify the returned signInMethods.
XCTAssertTrue(Thread.isMainThread)
XCTAssertEqual(signInMethods, allSignInMethods)
Expand All @@ -108,7 +108,7 @@
let message = "TOO_MANY_ATTEMPTS_TRY_LATER"
return try self.rpcIssuer.respond(serverErrorMessage: message)
}
auth?.fetchSignInMethods(forEmail: kEmail) { signInMethods, error in

Check warning on line 111 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, macOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 111 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, tvOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 111 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, catalyst)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 111 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-14, Xcode_16.2, iOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 111 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, iOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 111 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, visionOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.

Check warning on line 111 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, watchOS)

'fetchSignInMethods(forEmail:completion:)' is deprecated: `fetchSignInMethods` is deprecated and will be removed in a future release. This method returns an empty list when Email Enumeration Protection is enabled.
XCTAssertTrue(Thread.isMainThread)
XCTAssertNil(signInMethods)
let rpcError = (error as? NSError)!
Expand Down Expand Up @@ -2231,7 +2231,7 @@
let expectation2 = self.expectation(description: "dispatchAfterExpectation")
kAuthGlobalWorkQueue.async {
RPCBaseTests.waitSleep()
XCTAssertNotNil(self.authDispatcherCallback)

Check failure on line 2234 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, watchOS)

testAutomaticTokenRefreshRetry, XCTAssertNotNil failed
self.authDispatcherCallback?()
expectation2.fulfill()
}
Expand All @@ -2243,7 +2243,7 @@

// Verify that current user's access token is the "new" access token provided in the mock secure
// token response during automatic token refresh.
XCTAssertEqual(AuthTests.kNewAccessToken, auth.currentUser?.rawAccessToken())

Check failure on line 2246 in FirebaseAuth/Tests/Unit/AuthTests.swift

View workflow job for this annotation

GitHub Actions / spm / spm (macos-15, Xcode_16.4, watchOS)

testAutomaticTokenRefreshRetry, XCTAssertEqual failed: ("Optional("NEW_ACCESS_TOKEN")") is not equal to ("Optional("TEST_ACCESS_TOKEN")")
}

#if os(iOS)
Expand Down Expand Up @@ -2287,6 +2287,152 @@
}
#endif

// MARK: SAML IdP sign-in

#if os(iOS)

static let kSamlProviderId = "saml.idp"
static let kSamlAcsUrl = "https://example.com/saml-acs-url"
static let kSamlResponse = "BASE64_SAML_ASSERTION"
static let kBadSamlResponse = "MALFORMED_OR_TAMPERED_SAML"

func testSignInWithSamlIdpSuccess() throws {
let expectation = self.expectation(description: #function)
setFakeGetAccountProvider()
setFakeSecureTokenService()
rpcIssuer.respondBlock = {
let req = try XCTUnwrap(self.rpcIssuer.request as? SignInWithSamlIdpRequest)
XCTAssertEqual(req.requestConfiguration().apiKey, AuthTests.kFakeAPIKey)
XCTAssertEqual(
req.unencodedHTTPRequestBody?["requestUri"] as? String,
AuthTests.kSamlAcsUrl
)
XCTAssertTrue(
(req.unencodedHTTPRequestBody?["postBody"] as? String)?.contains(
AuthTests.kSamlProviderId
) ?? false
)
XCTAssertTrue(req.unencodedHTTPRequestBody?["returnSecureToken"] as? Bool ?? false)
return try self.rpcIssuer.respond(withJSON: [
"idToken": RPCBaseTests.kFakeAccessToken,
"refreshToken": self.kRefreshToken,
"email": self.kEmail,
"providerId": AuthTests.kSamlProviderId,
"expiresIn": "3600",
])
}
try auth.signOut()
Task {
do {
let result = try await self.auth.signInWithSamlIdp(
ProviderId: AuthTests.kSamlProviderId,
SpAcsUrl: AuthTests.kSamlAcsUrl,
SamlResp: AuthTests.kSamlResponse
)
XCTAssertEqual(result.user.email, self.kEmail)
XCTAssertEqual(result.user.refreshToken, self.kRefreshToken)
XCTAssertFalse(result.user.isAnonymous)
expectation.fulfill()
} catch {
XCTFail("Unexpected error: \(error)")
}
}
waitForExpectations(timeout: 5)
}

func testSignInWithSamlIdpWithIncorrectUrl() throws {
let expectation = self.expectation(description: #function)
let kBadSamlAcsUrl = "https://example.com/saml-acs-incorrect-url"
rpcIssuer.respondBlock = {
let req = try XCTUnwrap(self.rpcIssuer.request as? SignInWithSamlIdpRequest)
XCTAssertEqual(req.requestConfiguration().apiKey, AuthTests.kFakeAPIKey)
let body = try XCTUnwrap(req.unencodedHTTPRequestBody)
XCTAssertEqual(body["requestUri"] as? String, kBadSamlAcsUrl)
return try self.rpcIssuer.respond(serverErrorMessage: "OPERATION_NOT_ALLOWED")
}
try auth.signOut()
Task {
do {
_ = try await self.auth.signInWithSamlIdp(
ProviderId: AuthTests.kSamlProviderId,
SpAcsUrl: kBadSamlAcsUrl,
SamlResp: AuthTests.kSamlResponse
)
XCTFail("Expected OPERATION_NOT_ALLOWED")
} catch {
let ns = error as NSError
XCTAssertEqual(ns.code, AuthErrorCode.operationNotAllowed.rawValue)
expectation.fulfill()
}
}
waitForExpectations(timeout: 5)
XCTAssertNil(auth.currentUser)
}

func testSignInWithSamlIdpWithWrongProviderId() throws {
let expectation = self.expectation(description: #function)
let badProvider = "saml.non-existent-idp"
rpcIssuer.respondBlock = {
let req = try XCTUnwrap(self.rpcIssuer.request as? SignInWithSamlIdpRequest)
XCTAssertEqual(req.requestConfiguration().apiKey, AuthTests.kFakeAPIKey)
let body = try XCTUnwrap(req.unencodedHTTPRequestBody)
let postBody = try XCTUnwrap(body["postBody"] as? String)
XCTAssertTrue(postBody.contains("providerId=\(badProvider)"))
return try self.rpcIssuer.respond(serverErrorMessage: "OPERATION_NOT_ALLOWED")
}
try auth.signOut()
Task {
do {
_ = try await self.auth.signInWithSamlIdp(
ProviderId: badProvider, // wrong providerId
SpAcsUrl: AuthTests.kSamlAcsUrl,
SamlResp: AuthTests.kSamlResponse
)
XCTFail("Expected OPERATION_NOT_ALLOWED")
} catch {
let ns = error as NSError
XCTAssertEqual(ns.code, AuthErrorCode.operationNotAllowed.rawValue)
expectation.fulfill()
}
}
waitForExpectations(timeout: 5)
XCTAssertNil(auth.currentUser)
}

func testSignInWithSamlIdp_InvalidPostBody_InternalError() throws {
let expectation = self.expectation(description: #function)
rpcIssuer.respondBlock = {
let req = try XCTUnwrap(self.rpcIssuer.request as? SignInWithSamlIdpRequest)
XCTAssertEqual(req.requestConfiguration().apiKey, AuthTests.kFakeAPIKey)
let body = try XCTUnwrap(req.unencodedHTTPRequestBody)
XCTAssertEqual(body["requestUri"] as? String, AuthTests.kSamlAcsUrl)
let postBody = try XCTUnwrap(body["postBody"] as? String)
XCTAssertTrue(postBody.contains("SAMLResponse=\(AuthTests.kBadSamlResponse)"))
XCTAssertTrue(postBody.contains("providerId=\(AuthTests.kSamlProviderId)"))
XCTAssertTrue(body["returnSecureToken"] as? Bool ?? false)
return try self.rpcIssuer
.respond(underlyingErrorMessage: "INVALID_CREDENTIAL_OR_PROVIDER_ID")
}
try auth.signOut()
Task {
do {
_ = try await self.auth.signInWithSamlIdp(
ProviderId: AuthTests.kSamlProviderId,
SpAcsUrl: AuthTests.kSamlAcsUrl,
SamlResp: AuthTests.kBadSamlResponse
)
XCTFail("Expected internalError but got success")
} catch {
let ns = error as NSError
XCTAssertEqual(ns.code, AuthErrorCode.internalError.rawValue)
expectation.fulfill()
}
}
waitForExpectations(timeout: 5)
XCTAssertNil(auth.currentUser)
}
#endif

// MARK: Application Delegate tests.

#if os(iOS)
Expand Down
Loading
Loading