3.83.2. UpdateQuery Previous topic Parent topic Child topic Next topic

Specifies SQL query that will be used to store Yubikey token data back to the database after authentication. Special characters are permitted, and %0 is replaced with the new session counter, %1 with the new session_use counter, %2 with 0 (this column not currently used), %3 with the quoted user name, %4 with the quoted token ID in Base64, %5 with the current time (seconds in the unix epoch), %6 with the token ID in Hex and %7 with the token ID in modhex. The default works with the sample Yubikey database created by db_schema.sql from the YubiKey Validation Server. The default is:
UpdateQuery update yubikeys set accessed=current_timestamp(),
counter=%0, low=%1, high=%2 where userId=%3
which assumes that there is a one-to-one mapping between Yubikeys and users. You could support multiple tokens per user or multiple user per token with a custom Update- Query like:
UpdateQuery update yubikeys set accessed=current_timestamp(),
counter=%0, low=%1, high=%2 where tokenId=%4 and userId=%3