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.

186 lines
6.3 KiB

6 years ago
  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 "FIRAuthRPCResponse.h"
  18. NS_ASSUME_NONNULL_BEGIN
  19. /** @class FIRVerifyAssertionResponse
  20. @brief Represents the response from the verifyAssertion endpoint.
  21. @see https://developers.google.com/identity/toolkit/web/reference/relyingparty/verifyAssertion
  22. */
  23. @interface FIRVerifyAssertionResponse : NSObject <FIRAuthRPCResponse>
  24. /** @property federatedID
  25. @brief The unique ID identifies the IdP account.
  26. */
  27. @property(nonatomic, strong, readonly, nullable) NSString *federatedID;
  28. /** @property providerID
  29. @brief The IdP ID. For white listed IdPs it's a short domain name e.g. google.com, aol.com,
  30. live.net and yahoo.com. If the "providerId" param is set to OpenID OP identifer other than
  31. the whilte listed IdPs the OP identifier is returned. If the "identifier" param is federated
  32. ID in the createAuthUri request. The domain part of the federated ID is returned.
  33. */
  34. @property(nonatomic, strong, readonly, nullable) NSString *providerID;
  35. /** @property localID
  36. @brief The RP local ID if it's already been mapped to the IdP account identified by the
  37. federated ID.
  38. */
  39. @property(nonatomic, strong, readonly, nullable) NSString *localID;
  40. /** @property email
  41. @brief The email returned by the IdP. NOTE: The federated login user may not own the email.
  42. */
  43. @property(nonatomic, strong, readonly, nullable) NSString *email;
  44. /** @property inputEmail
  45. @brief It's the identifier param in the createAuthUri request if the identifier is an email. It
  46. can be used to check whether the user input email is different from the asserted email.
  47. */
  48. @property(nonatomic, strong, readonly, nullable) NSString *inputEmail;
  49. /** @property originalEmail
  50. @brief The original email stored in the mapping storage. It's returned when the federated ID is
  51. associated to a different email.
  52. */
  53. @property(nonatomic, strong, readonly, nullable) NSString *originalEmail;
  54. /** @property oauthRequestToken
  55. @brief The user approved request token for the OpenID OAuth extension.
  56. */
  57. @property(nonatomic, strong, readonly, nullable) NSString *oauthRequestToken;
  58. /** @property oauthScope
  59. @brief The scope for the OpenID OAuth extension.
  60. */
  61. @property(nonatomic, strong, readonly, nullable) NSString *oauthScope;
  62. /** @property firstName
  63. @brief The first name of the user.
  64. */
  65. @property(nonatomic, strong, readonly, nullable) NSString *firstName;
  66. /** @property lastName
  67. @brief The last name of the user.
  68. */
  69. @property(nonatomic, strong, readonly, nullable) NSString *lastName;
  70. /** @property fullName
  71. @brief The full name of the user.
  72. */
  73. @property(nonatomic, strong, readonly, nullable) NSString *fullName;
  74. /** @property nickName
  75. @brief The nick name of the user.
  76. */
  77. @property(nonatomic, strong, readonly, nullable) NSString *nickName;
  78. /** @property displayName
  79. @brief The display name of the user.
  80. */
  81. @property(nonatomic, strong, readonly, nullable) NSString *displayName;
  82. /** @property IDToken
  83. @brief Either an authorization code suitable for performing an STS token exchange, or the
  84. access token from Secure Token Service, depending on whether @c returnSecureToken is set
  85. on the request.
  86. */
  87. @property(nonatomic, strong, readonly, nullable) NSString *IDToken;
  88. /** @property approximateExpirationDate
  89. @brief The approximate expiration date of the access token.
  90. */
  91. @property(nonatomic, copy, readonly, nullable) NSDate *approximateExpirationDate;
  92. /** @property refreshToken
  93. @brief The refresh token from Secure Token Service.
  94. */
  95. @property(nonatomic, strong, readonly, nullable) NSString *refreshToken;
  96. /** @property action
  97. @brief The action code.
  98. */
  99. @property(nonatomic, strong, readonly, nullable) NSString *action;
  100. /** @property language
  101. @brief The language preference of the user.
  102. */
  103. @property(nonatomic, strong, readonly, nullable) NSString *language;
  104. /** @property timeZone
  105. @brief The timezone of the user.
  106. */
  107. @property(nonatomic, strong, readonly, nullable) NSString *timeZone;
  108. /** @property photoURL
  109. @brief The URI of the public accessible profile picture.
  110. */
  111. @property(nonatomic, strong, readonly, nullable) NSURL *photoURL;
  112. /** @property dateOfBirth
  113. @brief The birth date of the IdP account.
  114. */
  115. @property(nonatomic, strong, readonly, nullable) NSString *dateOfBirth;
  116. /** @property context
  117. @brief The opaque value used by the client to maintain context info between the authentication
  118. request and the IDP callback.
  119. */
  120. @property(nonatomic, strong, readonly, nullable) NSString *context;
  121. /** @property verifiedProvider
  122. @brief When action is 'map', contains the idps which can be used for confirmation.
  123. */
  124. @property(nonatomic, strong, readonly, nullable) NSArray<NSString *> *verifiedProvider;
  125. /** @property needConfirmation
  126. @brief Whether the assertion is from a non-trusted IDP and need account linking confirmation.
  127. */
  128. @property(nonatomic, assign) BOOL needConfirmation;
  129. /** @property emailRecycled
  130. @brief It's true if the email is recycled.
  131. */
  132. @property(nonatomic, assign) BOOL emailRecycled;
  133. /** @property emailVerified
  134. @brief The value is true if the IDP is also the email provider. It means the user owns the
  135. email.
  136. */
  137. @property(nonatomic, assign) BOOL emailVerified;
  138. /** @property isNewUser
  139. @brief Flag indicating that the user signing in is a new user and not a returning user.
  140. */
  141. @property(nonatomic, assign) BOOL isNewUser;
  142. /** @property profile
  143. @brief Dictionary containing the additional IdP specific information.
  144. */
  145. @property(nonatomic, readonly, nullable) NSDictionary<NSString *, NSObject *> *profile;
  146. /** @property username
  147. @brief The name of the user.
  148. */
  149. @property(nonatomic, strong, readonly, nullable) NSString *username;
  150. @end
  151. NS_ASSUME_NONNULL_END