DefaultDeviceAuthenticator
open class DefaultDeviceAuthenticator : DeviceAuthenticator
-
Generate public and private key pair
Declaration
Swift
open func generateKeys() throws -> FRCore.KeyPair
-
Check if authentication is supported
Declaration
Swift
open func isSupported() -> Bool
-
Access Control for the authetication type
Declaration
Swift
open func accessControl() -> SecAccessControl?
-
Get the Device Binding Authentication Type
Declaration
Swift
open func type() -> DeviceBindingAuthenticationType
-
Remove Keys
Declaration
Swift
open func deleteKeys()
-
Default implemention Sign the challenge sent from the server and generate signed JWT
Throws
DeviceBindingStatus
if any error occurs while signingDeclaration
Swift
open func sign(keyPair: KeyPair, kid: String, userId: String, challenge: String, expiration: Date) throws -> String
Parameters
keyPair
Public and private key pair
kid
Generated key id
userId
user Id received from server
challenge
challenge received from server
expiration
experation Date of jws
Return Value
compact serialized jws
-
Sign the challenge sent from the server and generate signed JWT
Throws
DeviceBindingStatus
if any error occurs while signingDeclaration
Swift
open func sign(userKey: UserKey, challenge: String, expiration: Date, customClaims: [String : Any] = [:]) throws -> String
Parameters
userKey
user Information
challenge
challenge received from server
expiration
experation Date of jws
customClaims
A dictionary of custom claims to be added to the jws payload
Return Value
compact serialized jws
-
Set the Authentication Prompt
Declaration
Swift
open func setPrompt(_ prompt: Prompt)
-
initialize already created entity with useriD and Promp
Declaration
Swift
open func initialize(userId: String, prompt: Prompt)
Parameters
userId
userId of the authentication
prompt
Prompt containing the description for authentication
-
initialize already created entity with useriD and Promp
Declaration
Swift
open func initialize(userId: String)
Parameters
userId
userId of the authentication
-
Get the token signed issue time.
Declaration
Swift
open func issueTime() -> Date
-
Get the token not before time.
Declaration
Swift
open func notBeforeTime() -> Date
-
Validate custom claims
Declaration
Swift
open func validateCustomClaims(_ customClaims: [String : Any]) -> Bool
Parameters
customClaims
A dictionary of custom claims to be validated
Return Value
Bool value indicating whether the custom claims are valid or not