TapAuthAccessToken.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // TapAuthAccessToken.h
  3. // TapCommonSDK
  4. //
  5. // Created by 黄驿峰 on 2022/1/26.
  6. //
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. /// TapTap authorization token
  10. @interface TapAuthAccessToken : NSObject
  11. /// A unique identifier
  12. @property (nonatomic, copy, nullable) NSString * kid;
  13. /// access token
  14. @property (nonatomic, copy, nullable) NSString * accessToken;
  15. /// token Type
  16. @property (nonatomic, copy, nullable) NSString * tokenType;
  17. /// mac key
  18. @property (nonatomic, copy, nullable) NSString * macKey;
  19. /// mac key algorithm
  20. @property (nonatomic, copy, nullable) NSString * macAlgorithm;
  21. /// Multiple user permissions are separated by commas (,)
  22. @property (nonatomic, copy, nullable) NSString * scope;
  23. + (TapAuthAccessToken *)buildWithKid:(NSString *)kid accessToken:(NSString *)accessToken tokenType:(NSString *)tokenType macKey:(NSString *)macKey macAlgorithm:(NSString *)macAlgorithm;
  24. + (nullable TapAuthAccessToken *)buildWithJsonString:(NSString *)jsonString;
  25. + (nullable TapAuthAccessToken *)buildWithQueryString:(NSString *)queryString;
  26. + (nullable TapAuthAccessToken *)buildWithDic:(NSDictionary *)dic;
  27. - (NSString *)tokenToQueryString;
  28. - (NSString *)tokenToJsonString;
  29. //+ (void)clearLocalAccessToken;
  30. //- (void)saveToLocal;
  31. //+ (nullable TapAuthAccessToken *)loadLocalAccessToken;
  32. - (BOOL)containCompliancePermission;
  33. @end
  34. NS_ASSUME_NONNULL_END