AuthExchangeResult.swift 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * A class that wraps around the Auth Exchange response from the backend. This will always contain the `AuthExchangeToken`. For
  16. * some provider flows (i.e. OIDC), a provider ID token and/or a provider refresh token may also be returned.
  17. */
  18. @objc(FIRAuthExchangeResult) public class AuthExchangeResult: NSObject {
  19. @objc public init(authExchangeToken: AuthExchangeToken, providerIDToken: String?,
  20. providerRefreshToken: String?) {
  21. self.authExchangeToken = authExchangeToken
  22. self.providerIDToken = providerIDToken
  23. self.providerRefreshToken = providerRefreshToken
  24. }
  25. @objc public init(authExchangeToken: AuthExchangeToken) {
  26. self.authExchangeToken = authExchangeToken
  27. providerIDToken = nil
  28. providerRefreshToken = nil
  29. }
  30. @objc public let authExchangeToken: AuthExchangeToken
  31. @objc public let providerIDToken: String?
  32. @objc public let providerRefreshToken: String?
  33. }