commit | author | age
|
2e29a3
|
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 |
|
e0ec42
|
11 |
#import <FBSDKCoreKit/FBSDKAuthenticationTokenProviding.h> |
L |
12 |
|
2e29a3
|
13 |
@class FBSDKAuthenticationTokenClaims; |
L |
14 |
@protocol FBSDKTokenCaching; |
|
15 |
|
|
16 |
NS_ASSUME_NONNULL_BEGIN |
|
17 |
|
e0ec42
|
18 |
/// Represent an AuthenticationToken used for a login attempt |
2e29a3
|
19 |
NS_SWIFT_NAME(AuthenticationToken) |
e0ec42
|
20 |
@interface FBSDKAuthenticationToken : NSObject <NSCopying, NSObject, NSSecureCoding, FBSDKAuthenticationTokenProviding> |
L |
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; |
2e29a3
|
31 |
|
L |
32 |
- (instancetype)init NS_UNAVAILABLE; |
|
33 |
+ (instancetype)new NS_UNAVAILABLE; |
|
34 |
|
|
35 |
/** |
e0ec42
|
36 |
The "global" authentication token that represents the currently logged in user. |
2e29a3
|
37 |
|
L |
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 |
*/ |
e0ec42
|
41 |
@property (class, nullable, nonatomic, copy) FBSDKAuthenticationToken *currentAuthenticationToken NS_SWIFT_NAME(current); |
2e29a3
|
42 |
|
e0ec42
|
43 |
/// The raw token string from the authentication response |
2e29a3
|
44 |
@property (nonatomic, readonly, copy) NSString *tokenString; |
L |
45 |
|
e0ec42
|
46 |
/// The nonce from the decoded authentication response |
2e29a3
|
47 |
@property (nonatomic, readonly, copy) NSString *nonce; |
L |
48 |
|
e0ec42
|
49 |
/// The graph domain where the user is authenticated. |
2e29a3
|
50 |
@property (nonatomic, readonly, copy) NSString *graphDomain; |
L |
51 |
|
e0ec42
|
52 |
/// Returns the claims encoded in the AuthenticationToken |
2e29a3
|
53 |
- (nullable FBSDKAuthenticationTokenClaims *)claims; |
L |
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 |
|
e0ec42
|
63 |
#pragma mark - Test methods |
L |
64 |
|
|
65 |
#if DEBUG |
|
66 |
- (instancetype)initWithTokenString:(NSString *)tokenString |
|
67 |
nonce:(NSString *)nonce; |
|
68 |
+ (void)resetCurrentAuthenticationTokenCache; |
|
69 |
#endif |
|
70 |
|
2e29a3
|
71 |
@end |
L |
72 |
|
|
73 |
NS_ASSUME_NONNULL_END |