FIRSecureTokenRequest.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 "FirebaseAuth/Sources/Backend/FIRAuthRPCRequest.h"
  18. NS_ASSUME_NONNULL_BEGIN
  19. /** @class FIRSecureTokenRequest
  20. @brief Represents the parameters for the token endpoint.
  21. */
  22. @interface FIRSecureTokenRequest : NSObject <FIRAuthRPCRequest>
  23. /** @property refreshToken
  24. @brief The client's refresh token.
  25. */
  26. @property(nonatomic, copy, readonly, nullable) NSString *refreshToken;
  27. /** @property APIKey
  28. @brief The client's API Key.
  29. */
  30. @property(nonatomic, copy, readonly) NSString *APIKey;
  31. /** @fn refreshRequestWithRefreshToken:requestConfiguration:
  32. @brief Creates a refresh request with the given refresh token.
  33. @param refreshToken The refresh token.
  34. @param requestConfiguration An object containing configurations to be added to the request.
  35. @return A refresh request.
  36. */
  37. + (FIRSecureTokenRequest *)refreshRequestWithRefreshToken:(NSString *)refreshToken
  38. requestConfiguration:
  39. (FIRAuthRequestConfiguration *)requestConfiguration;
  40. /** @fn init
  41. @brief Please use initWithRefreshToken:requestConfiguration:
  42. */
  43. - (instancetype)init NS_UNAVAILABLE;
  44. /** @fn initWithRefreshToken:requestConfiguration:
  45. @brief Designated initializer.
  46. @param refreshToken The client's refresh token (for refresh requests.)
  47. @param requestConfiguration An object containing configurations to be added to the request.
  48. */
  49. - (nullable instancetype)initWithRefreshToken:(NSString *)refreshToken
  50. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  51. NS_DESIGNATED_INITIALIZER;
  52. @end
  53. NS_ASSUME_NONNULL_END