Brak opisu

FIRVerifyAssertionRequest.h 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 "FIRAuthRPCRequest.h"
  18. #import "FIRIdentityToolkitRequest.h"
  19. NS_ASSUME_NONNULL_BEGIN
  20. /** @class FIRVerifyAssertionRequest
  21. @brief Represents the parameters for the verifyAssertion endpoint.
  22. @see https://developers.google.com/identity/toolkit/web/reference/relyingparty/verifyAssertion
  23. */
  24. @interface FIRVerifyAssertionRequest : FIRIdentityToolkitRequest <FIRAuthRPCRequest>
  25. /** @property requestURI
  26. @brief The URI to which the IDP redirects the user back. It may contain federated login result
  27. params added by the IDP.
  28. */
  29. @property(nonatomic, copy, nullable) NSString *requestURI;
  30. /** @property pendingToken
  31. @brief The Firebase ID Token for the IDP pending to be confirmed by the user.
  32. */
  33. @property(nonatomic, copy, nullable) NSString *pendingToken;
  34. /** @property accessToken
  35. @brief The STS Access Token for the authenticated user, only needed for linking the user.
  36. */
  37. @property(nonatomic, copy, nullable) NSString *accessToken;
  38. /** @property returnSecureToken
  39. @brief Whether the response should return access token and refresh token directly.
  40. @remarks The default value is @c YES .
  41. */
  42. @property(nonatomic, assign) BOOL returnSecureToken;
  43. #pragma mark - Components of "postBody"
  44. /** @property providerID
  45. @brief The ID of the IDP whose credentials are being presented to the endpoint.
  46. */
  47. @property(nonatomic, copy, readonly) NSString *providerID;
  48. /** @property providerAccessToken
  49. @brief An access token from the IDP.
  50. */
  51. @property(nonatomic, copy, nullable) NSString *providerAccessToken;
  52. /** @property providerIDToken
  53. @brief An ID Token from the IDP.
  54. */
  55. @property(nonatomic, copy, nullable) NSString *providerIDToken;
  56. /** @property providerRawNonce
  57. @brief An raw nonce from the IDP.
  58. */
  59. @property(nonatomic, copy, nullable) NSString *providerRawNonce;
  60. /** @property returnIDPCredential
  61. @brief Whether the response should return the IDP credential directly.
  62. */
  63. @property(nonatomic, assign) BOOL returnIDPCredential;
  64. /** @property providerOAuthTokenSecret
  65. @brief A session ID used to map this request to a headful-lite flow.
  66. */
  67. @property(nonatomic, copy, nullable) NSString *sessionID;
  68. /** @property providerOAuthTokenSecret
  69. @brief An OAuth client secret from the IDP.
  70. */
  71. @property(nonatomic, copy, nullable) NSString *providerOAuthTokenSecret;
  72. /** @property inputEmail
  73. @brief The originally entered email in the UI.
  74. */
  75. @property(nonatomic, copy, nullable) NSString *inputEmail;
  76. /** @property autoCreate
  77. @brief A flag that indicates whether or not the user should be automatically created.
  78. */
  79. @property(nonatomic, assign) BOOL autoCreate;
  80. /** @fn initWithEndpoint:requestConfiguration:
  81. @brief Please use initWithProviderID:requestConfifuration instead.
  82. */
  83. - (nullable instancetype)initWithEndpoint:(NSString *)endpoint
  84. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  85. NS_UNAVAILABLE;
  86. /** @fn initWithProviderID:requestConfifuration
  87. @brief Designated initializer.
  88. @param providerID The auth provider's ID.
  89. @param requestConfiguration An object containing configurations to be added to the request.
  90. */
  91. - (nullable instancetype)initWithProviderID:(NSString *)providerID
  92. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  93. NS_DESIGNATED_INITIALIZER;
  94. @end
  95. NS_ASSUME_NONNULL_END