OIDTokenResponse+Testing.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright 2021 Google LLC
  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. #ifdef SWIFT_PACKAGE
  17. @import AppAuth;
  18. #else
  19. #import <AppAuth/OIDTokenResponse.h>
  20. #endif
  21. extern NSString *const kAccessToken;
  22. extern NSTimeInterval const kAccessTokenExpiresIn;
  23. extern NSString *const kRefreshToken;
  24. extern NSString *const kServerAuthCode;
  25. // ID token constants
  26. extern NSString *const kAlg;
  27. extern NSString *const kKid;
  28. extern NSString *const kTyp;
  29. extern NSString *const kUserID;
  30. extern NSString *const kHostedDomain;
  31. extern NSString *const kIssuer;
  32. extern NSString *const kAudience;
  33. extern NSTimeInterval const kIDTokenExpires;
  34. extern NSTimeInterval const kIssuedAt;
  35. extern NSString *const kFatNameKey;
  36. extern NSString *const kFatGivenNameKey;
  37. extern NSString *const kFatFamilyNameKey;
  38. extern NSString *const kFatPictureURLKey;
  39. extern NSString * const kFatName;
  40. extern NSString * const kFatGivenName;
  41. extern NSString * const kFatFamilyName;
  42. extern NSString * const kFatPictureURL;
  43. @interface OIDTokenResponse (Testing)
  44. + (instancetype)testInstance;
  45. + (instancetype)testInstanceWithIDToken:(NSString *)idToken;
  46. + (instancetype)testInstanceWithIDToken:(NSString *)idToken
  47. accessToken:(NSString *)accessToken
  48. expiresIn:(NSNumber *)expiresIn
  49. tokenRequest:(OIDTokenRequest *)tokenRequest;
  50. + (NSString *)idToken;
  51. + (NSString *)fatIDToken;
  52. + (NSString *)idTokenWithSub:(NSString *)sub exp:(NSNumber *)exp;
  53. + (NSString *)idTokenWithSub:(NSString *)sub exp:(NSNumber *)exp fat:(BOOL)fat;
  54. @end