Validating Cotter's Event Response
Cotter's Event Response includes the following information:
First, make sure you check the following:
Check if the
client_user_id
is correctCheck if the
timestamp
is fairly recentCheck if the
event
matches the event name that you expectedCheck that the
issuer
is the same as yourAPI_KEY_ID
Check that
approved
is true
Verifying the Signature
The signature ensures that this token comes from Cotter's server:
Signature algorithm:
ed25519
Cotter's Public Key:
qqOaiQGjGsxBMgI5rdAasaACRiJthOqadmefjY5mS/c=
Signed Message:
Note that there is no space and no {}
in the message. It's all just 1 long string. ex. 152163b39fb6eb-a1ff-4f7b-a205-d80f3c664cfdEVENTNAME1584659078TRUSTED_DEVICEfalsetrue
Example
Libraries for ed25519
algorithm are available in Javascript, Golang, Python and other languages.
Last updated