commit | author | age
|
e0ec42
|
1 |
/* |
L |
2 |
* Copyright (c) Meta Platforms, Inc. and affiliates. |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* This source code is licensed under the license found in the |
|
6 |
* LICENSE file in the root directory of this source tree. |
|
7 |
*/ |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
|
|
11 |
#import <FBSDKCoreKit/FBSDKAuthenticationTokenProviding.h> |
|
12 |
|
|
13 |
@class FBSDKAuthenticationTokenClaims; |
|
14 |
@protocol FBSDKTokenCaching; |
|
15 |
|
|
16 |
NS_ASSUME_NONNULL_BEGIN |
|
17 |
|
|
18 |
/// Represent an AuthenticationToken used for a login attempt |
|
19 |
NS_SWIFT_NAME(AuthenticationToken) |
|
20 |
@interface FBSDKAuthenticationToken : NSObject <NSCopying, NSObject, NSSecureCoding, FBSDKAuthenticationTokenProviding> |
|
21 |
|
|
22 |
/** |
|
23 |
Internal init method exposed to facilitate transition to Swift. |
|
24 |
API Subject to change or removal without warning. Do not use. |
|
25 |
|
|
26 |
@warning INTERNAL - DO NOT USE |
|
27 |
*/ |
|
28 |
- (instancetype)initWithTokenString:(NSString *)tokenString |
|
29 |
nonce:(NSString *)nonce |
|
30 |
graphDomain:(NSString *)graphDomain; |
|
31 |
|
|
32 |
- (instancetype)init NS_UNAVAILABLE; |
|
33 |
+ (instancetype)new NS_UNAVAILABLE; |
|
34 |
|
|
35 |
/** |
|
36 |
The "global" authentication token that represents the currently logged in user. |
|
37 |
|
|
38 |
The `currentAuthenticationToken` represents the authentication token of the |
|
39 |
current user and can be used by a client to verify an authentication attempt. |
|
40 |
*/ |
|
41 |
@property (class, nullable, nonatomic, copy) FBSDKAuthenticationToken *currentAuthenticationToken NS_SWIFT_NAME(current); |
|
42 |
|
|
43 |
/// The raw token string from the authentication response |
|
44 |
@property (nonatomic, readonly, copy) NSString *tokenString; |
|
45 |
|
|
46 |
/// The nonce from the decoded authentication response |
|
47 |
@property (nonatomic, readonly, copy) NSString *nonce; |
|
48 |
|
|
49 |
/// The graph domain where the user is authenticated. |
|
50 |
@property (nonatomic, readonly, copy) NSString *graphDomain; |
|
51 |
|
|
52 |
/// Returns the claims encoded in the AuthenticationToken |
|
53 |
- (nullable FBSDKAuthenticationTokenClaims *)claims; |
|
54 |
|
|
55 |
/** |
|
56 |
Internal Type exposed to facilitate transition to Swift. |
|
57 |
API Subject to change or removal without warning. Do not use. |
|
58 |
|
|
59 |
@warning INTERNAL - DO NOT USE |
|
60 |
*/ |
|
61 |
@property (class, nullable, nonatomic, copy) id<FBSDKTokenCaching> tokenCache; |
|
62 |
|
|
63 |
#pragma mark - Test methods |
|
64 |
|
|
65 |
#if DEBUG |
|
66 |
- (instancetype)initWithTokenString:(NSString *)tokenString |
|
67 |
nonce:(NSString *)nonce; |
|
68 |
+ (void)resetCurrentAuthenticationTokenCache; |
|
69 |
#endif |
|
70 |
|
|
71 |
@end |
|
72 |
|
|
73 |
NS_ASSUME_NONNULL_END |