You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.8 KiB

  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #if TARGET_OS_IOS
  18. #import "FIRAuthUIDelegate.h"
  19. #endif // TARGET_OS_IOS
  20. @class FIRAuthCredential;
  21. NS_ASSUME_NONNULL_BEGIN
  22. NS_SWIFT_NAME(FederatedAuthProvider)
  23. @protocol FIRFederatedAuthProvider <NSObject>
  24. /** @typedef FIRAuthCredentialCallback
  25. @brief The type of block invoked when obtaining an auth credential.
  26. @param credential The credential obtained.
  27. @param error The error that occurred if any.
  28. */
  29. typedef void(^FIRAuthCredentialCallback)(FIRAuthCredential *_Nullable credential,
  30. NSError *_Nullable error)
  31. NS_SWIFT_NAME(AuthCredentialCallback);
  32. #if TARGET_OS_IOS
  33. /** @fn getCredentialWithUIDelegate:completion:
  34. @brief Used to obtain an auth credential via a mobile web flow.
  35. @param UIDelegate An optional UI delegate used to presenet the mobile web flow.
  36. @param completion Optionally; a block which is invoked asynchronously on the main thread when
  37. the mobile web flow is completed.
  38. */
  39. - (void)getCredentialWithUIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
  40. completion:(nullable FIRAuthCredentialCallback)completion;
  41. #endif // TARGET_OS_IOS
  42. @end
  43. NS_ASSUME_NONNULL_END