FIRAuthTVPollRequest.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 "FIRAuthTVPollRequest.h"
  17. #import "FIRAuthTVCode.h"
  18. @implementation FIRAuthTVPollRequest
  19. - (instancetype)initWithClientID:(NSString *)clientID
  20. clientSecret:(NSString *)clientSecret
  21. deviceCode:(NSString *)deviceCode {
  22. if (self = [super init]) {
  23. self.clientID = clientID;
  24. self.clientSecret = clientSecret;
  25. self.deviceCode = deviceCode;
  26. }
  27. return self;
  28. }
  29. - (NSDictionary <NSString *, NSString *>*)generatedParameters {
  30. // TODO: Make these constant.
  31. return @{
  32. @"client_id": self.clientID,
  33. @"client_secret": self.clientSecret,
  34. @"code": self.deviceCode,
  35. @"grant_type": @"http://oauth.net/grant_type/device/1.0"
  36. };
  37. }
  38. @end