OIDTokenResponse+Testing.h 2.0 KB

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