SPTSession Class Reference
Inherits from | NSObject |
Conforms to | NSSecureCoding |
Declared in | SPTSession.h |
Overview
For persisting the session, you may use NSKeyedArchiver
to obtain an NSData
instance, which can
be stored securely using Keychain Services.
Note: A session is valid for a certain period of time, and may be renewed without user intervention using SPTAuth
.
Tasks
Initialisation
-
– initWithUserName:accessToken:expirationDate:
-
– initWithUserName:accessToken:encryptedRefreshToken:expirationDate:
-
– initWithUserName:accessToken:expirationTimeInterval:
Properties
-
– isValid
-
canonicalUsername
property -
accessToken
property -
encryptedRefreshToken
property -
expirationDate
property -
tokenType
property
Properties
accessToken
The access token of the authenticated user.
@property (nonatomic, copy, readonly) NSString *accessToken
Declared In
SPTSession.h
canonicalUsername
The canonical username of the authenticated user.
@property (nonatomic, copy, readonly) NSString *canonicalUsername
Declared In
SPTSession.h
encryptedRefreshToken
The encrypted refresh token.
@property (nonatomic, copy, readonly) NSString *encryptedRefreshToken
Declared In
SPTSession.h
Instance Methods
initWithUserName:accessToken:encryptedRefreshToken:expirationDate:
The deignated initializer for SPTSession
.
- (instancetype)initWithUserName:(NSString *)userName accessToken:(NSString *)accessToken encryptedRefreshToken:(NSString *)encryptedRefreshToken expirationDate:(NSDate *)expirationDate
Parameters
- userName
The username of the user.
- accessToken
The access token of the user.
- encryptedRefreshToken
The encrypted refresh token of the user.
- expirationDate
The expiration date of the access token.
Return Value
An initialized SPTSession
object.
Declared In
SPTSession.h
initWithUserName:accessToken:expirationDate:
The deignated initializer for SPTSession
.
- (instancetype)initWithUserName:(NSString *)userName accessToken:(NSString *)accessToken expirationDate:(NSDate *)expirationDate
Parameters
- userName
The username of the user.
- accessToken
The access token of the user.
- expirationDate
The expiration date of the access token.
Return Value
An initialized SPTSession
object.
Declared In
SPTSession.h
initWithUserName:accessToken:expirationTimeInterval:
Initializer that takes an NSTimeInterval
until the access token expires, instead of an NSDate
.
- (instancetype)initWithUserName:(NSString *)userName accessToken:(NSString *)accessToken expirationTimeInterval:(NSTimeInterval)timeInterval
Parameters
- userName
The username of the user.
- accessToken
The access token of the user.
- timeInterval
The time interval until the access token expires.
Return Value
An initialized SPTSession
object.
Declared In
SPTSession.h