A class is exposed under the cym package which allows you to use WebAuthn
global static Map<String, Object> initRegisterWebAuthn(cym.Community.Authenticator authenticator)
authenticator (cym.Community.Authenticator) - Since you can have multiple authenticators which use WebAuthn, you need to provide the correct instance
Map<String, Object> : the attributes required for a WebAuthn Registration. The map has two keys :
transactionId : An identifier for the transaction which must be provided back to verifyRegisterWebAuthnpublicKey : A Map<String, Object> which can be passed to navigator.credentials.create
global static Credential verifyRegisterWebAuthn(Map<String, String> attestationResponse, cym.Community.Authenticator authenticator)
attestationResponse (Map<String, String>) - The response received from navigator.credentials.create which has the following attributes :
transactionId : The value retrieved from the initRegisterWebAuthn callid : The id returned by the authenticatorrawId : base64url encoded value of the rawId returned by the authenticatorattestationObject : base64url encoded value of the attestationObjectclientDataJSON : base64url encoded value of the clientDataJSONtransports : JSON.stringify value of the getTransports call on the navigator.credentials.create response
authenticator (cym.Community.Authenticator) - Since you can have multiple authenticators which use WebAuthn, you need to provide the correct instance
Credential : the credential which was created and stored on the database.
global static Map<String, Object> initVerificationWebAuthn(cym.Community.Authenticator authenticator)
authenticator (cym.Community.Authenticator) - Since you can have multiple authenticators which use WebAuthn, you need to provide the correct instance
Map<String, Object> : the attributes required for a WebAuthn Verification. The map has two keys :
transactionId : An identifier for the transaction which must be provided back to verifyRegisterWebAuthnpublicKey : A Map<String, Object> which can be passed to navigator.credentials.get
global static Boolean verifyVerificationWebAuthn(Map<String, String> assertionResponse, cym.Community.Authenticator authenticator)
assertionResponse (Map<String, String>) - The response received from navigator.credentials.create which has the following attributes :
transactionId : The value retrieved from the initRegisterWebAuthn callid : The id returned by the authenticatorrawId : base64url encoded value of the rawId returned by the authenticatorauthenticatorData : base64url encoded value of the authenticatorDataclientDataJSON : base64url encoded value of the clientDataJSONsignature : base64url value of the signature
authenticator (cym.Community.Authenticator) - Since you can have multiple authenticators which use WebAuthn, you need to provide the correct instance
Boolean : whether the signature matches the public key stored in the database
global static Credential[] getAllCredentials()
Credential[] : List all
credentials stored in the database for the current user.