DeviceAuthenticator
public protocol DeviceAuthenticator
Protocol to override keypair generation, authentication, signing and access control
-
Generate public and private key pair
Declaration
Swift
func generateKeys() throws -> KeyPair -
Sign the challenge sent from the server and generate signed JWT
Throws
DeviceBindingStatusif any error occurs while signingDeclaration
Swift
func sign(keyPair: KeyPair, kid: String, userId: String, challenge: String, expiration: Date) throws -> StringParameters
keyPairPublic and private key pair
kidGenerated key id
userIduser Id received from server
challengechallenge received from server
expirationexperation Date of jws
Return Value
compact serialized jws
-
Sign the challenge sent from the server and generate signed JWT
Throws
DeviceBindingStatusif any error occurs while signingDeclaration
Swift
func sign(userKey: UserKey, challenge: String, expiration: Date, customClaims: [String : Any]) throws -> StringParameters
userKeyuser Information
challengechallenge received from server
expirationexperation Date of jws
customClaimsA dictionary of custom claims to be added to the jws payload
Return Value
compact serialized jws
-
Check if authentication is supported
Declaration
Swift
func isSupported() -> Bool -
Access Control for the authetication type
Declaration
Swift
func accessControl() -> SecAccessControl? -
Set the Authentication Prompt
Declaration
Swift
func setPrompt(_ prompt: Prompt) -
Get the Device Binding Authentication Type
Declaration
Swift
func type() -> DeviceBindingAuthenticationType -
initialize already created entity with useriD and Promp
Declaration
Swift
func initialize(userId: String, prompt: Prompt)Parameters
userIduserId of the authentication
promptPrompt containing the description for authentication
-
initialize already created entity with useriD and Promp
Declaration
Swift
func initialize(userId: String)Parameters
userIduserId of the authentication
-
Remove Keys
Declaration
Swift
func deleteKeys() -
Get the token signed issue time.
Declaration
Swift
func issueTime() -> Date -
Get the token not before time.
Declaration
Swift
func notBeforeTime() -> Date -
Validate custom claims
Declaration
Swift
func validateCustomClaims(_ customClaims: [String : Any]) -> BoolParameters
customClaimsA dictionary of custom claims to be validated
Return Value
Bool value indicating whether the custom claims are valid or not
View on GitHub