説明なし

FIROAuthProvider.h 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. #import "FIRFederatedAuthProvider.h"
  18. @class FIRAuth;
  19. @class FIROAuthCredential;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /** @class FIROAuthProvider
  22. @brief A concrete implementation of `FIRAuthProvider` for generic OAuth Providers.
  23. */
  24. NS_SWIFT_NAME(OAuthProvider)
  25. @interface FIROAuthProvider : NSObject<FIRFederatedAuthProvider>
  26. /** @property scopes
  27. @brief Array used to configure the OAuth scopes.
  28. */
  29. @property(nonatomic, copy, nullable) NSArray<NSString *> *scopes;
  30. /** @property customParameters
  31. @brief Dictionary used to configure the OAuth custom parameters.
  32. */
  33. @property(nonatomic, copy, nullable) NSDictionary<NSString *, NSString*> *customParameters;
  34. /** @property providerID
  35. @brief The provider ID indicating the specific OAuth provider this OAuthProvider instance
  36. represents.
  37. */
  38. @property(nonatomic, copy, readonly) NSString *providerID;
  39. /** @fn providerWithProviderID:
  40. @param providerID The provider ID of the IDP for which this auth provider instance will be
  41. configured.
  42. @return An instance of FIROAuthProvider corresponding to the specified provider ID.
  43. */
  44. + (FIROAuthProvider *)providerWithProviderID:(NSString *)providerID;
  45. /** @fn providerWithProviderID:auth:
  46. @param providerID The provider ID of the IDP for which this auth provider instance will be
  47. configured.
  48. @param auth The auth instance to be associated with the FIROAuthProvider instance.
  49. @return An instance of FIROAuthProvider corresponding to the specified provider ID.
  50. */
  51. + (FIROAuthProvider *)providerWithProviderID:(NSString *)providerID auth:(FIRAuth *)auth;
  52. /** @fn credentialWithProviderID:IDToken:accessToken:
  53. @brief Creates an `FIRAuthCredential` for that OAuth 2 provider identified by providerID, ID
  54. token and access token.
  55. @param providerID The provider ID associated with the Auth credential being created.
  56. @param IDToken The IDToken associated with the Auth credential being created.
  57. @param accessToken The accessstoken associated with the Auth credential be created, if
  58. available.
  59. @return A FIRAuthCredential for the specified provider ID, ID token and access token.
  60. */
  61. + (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
  62. IDToken:(NSString *)IDToken
  63. accessToken:(nullable NSString *)accessToken;
  64. /** @fn credentialWithProviderID:accessToken:
  65. @brief Creates an `FIRAuthCredential` for that OAuth 2 provider identified by providerID using
  66. an ID token.
  67. @param providerID The provider ID associated with the Auth credential being created.
  68. @param accessToken The accessstoken associated with the Auth credential be created
  69. @return A FIRAuthCredential.
  70. */
  71. + (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
  72. accessToken:(NSString *)accessToken;
  73. /** @fn credentialWithProviderID:IDToken:rawNonce:accessToken:
  74. @brief Creates an `FIRAuthCredential` for that OAuth 2 provider identified by providerID, ID
  75. token, raw nonce and access token.
  76. @param providerID The provider ID associated with the Auth credential being created.
  77. @param IDToken The IDToken associated with the Auth credential being created.
  78. @param rawNonce The raw nonce associated with the Auth credential being created.
  79. @param accessToken The accessstoken associated with the Auth credential be created, if
  80. available.
  81. @return A FIRAuthCredential for the specified provider ID, ID token and access token.
  82. */
  83. + (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
  84. IDToken:(NSString *)IDToken
  85. rawNonce:(nullable NSString *)rawNonce
  86. accessToken:(nullable NSString *)accessToken;
  87. /** @fn credentialWithProviderID:IDToken:rawNonce:
  88. @brief Creates an `FIRAuthCredential` for that OAuth 2 provider identified by providerID using
  89. an ID token and raw nonce.
  90. @param providerID The provider ID associated with the Auth credential being created.
  91. @param IDToken The IDToken associated with the Auth credential being created.
  92. @param rawNonce The raw nonce associated with the Auth credential being created.
  93. @return A FIRAuthCredential.
  94. */
  95. + (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
  96. IDToken:(NSString *)IDToken
  97. rawNonce:(nullable NSString *)rawNonce;
  98. /** @fn init
  99. @brief This class is not meant to be initialized.
  100. */
  101. - (instancetype)init NS_UNAVAILABLE;
  102. @end
  103. NS_ASSUME_NONNULL_END