First about SECKFMSwitchToIDFile:
It was nice when this had been added to capi (5.03?), before you could only use REGSwitchID (which was undocumented).
But it really has some problems:
*) it lacks support of multi-pwd ids and smartcards. ok so far, you can’t get everything. but: there isn’t a single capi-function to find out which id-file is multi-user or smartcard. worst is when switching to such id-files it doesn’t tell you “can’t switch” or “unsupported id-file”. you have to waste a lot of time/effort to find out yourself, using undocument functions , test it so it works for r4-r7…
*) after authentification (in nsf_hook or extmgr_addin) in r6 and using same id as last time, you’ll get prompted again when notes finished startup. unaccaptable. what to do? you have to securely store password in mem, register EM_GETPASSWORD and “forward” it. that’s only half the truth. what if notes doesn’t prompt again? ok: check id_file path. but what if user clicks “user security”? it should prompt for password. a lot of work to do. sometimes this happens also in r5, but less frequent. this problem has been reported first in 2002.
since you can’t just rename KEYFILENAME, cause it looks as if being
cached you can again try to go the unsupported way. there are functions you can use before calling SECKFMSwitchToIDFile so it switched to supplied id (and not doing anything cause it thinks nothing has changed), but these functions have such frightening names you don’t really want to…
*) SSO (Single Sign On) is ignored. Since this is such a common feature, you’ll have to support it “yourself”. How does it work? Well, easy, just needs some weeks and a lot of coffee:)
*) Warnings about “your password will expire on…”. Using SECKFMSwitchToIDFile you’ll miss these ones. Does anybody now a way to get expiry date? Whould be nice to know - to avoid using undocumented stuff
*) EM_GETPASSWORD & MultiUser Ids: First i thought, no way, once your in your stuck. But unexpectly it works fine, the ext-handler just appears more than once. But again: notes usually displays infos about all users and for whom password still needs to be supplied. but since we already found out how to detect such an id-file, just return ERR_EMCONTINUE and let notes handle that.
*) EM_GETPASSWORD & Smartcard Ids
with r<6.04 & r<6.51 notes calls ext-handler and there’s no way to supply password/pin. message “wrong password”.
I’m very glad Dave Kern has fixed this issue (or at least reported it) for r6.04/r6.51
*) EM_GETPASSWORD & missing feature
normally if you’re using SSO you get a warning that your password isn’t the same as NT/Domain password. Using EM_GETPASSWORD this feature is missing. You can try to check password yourself with calling some functions (documented?
and check if EM_GETPASSWORD is called again. If recursion occures you know it’s wrong. compare it to sso pwd, do a prompt if needed and continue.
*) EM_GETPASSWORD & MAPI & XP
in win-world you can use notes like you use outlook (hopefully you don’t:), if notes is registerd as default mailprogram, one can launch/use notes with e.g. (file)explorer/send to/mail recepient) or use a mail-link from your browser.
Compile&Install api-sample misc/extmgr, install it so it prompts password at beginning. Use one of above described ways to send a mail. notes is launched, prompts password, wait around 10 secs - Explorer! Crashes. This happens at least with Win2000/XP, but might also with others. That’s for shure a bug in windwows. looks like you’ll have to be quick with responses. i guess that happens, cause message pump doesn’t respond. but i’d appreciate having a way to avoid this.
*) EM_GETPASSWORD & Startup
the notes login dialog has evolved ever since. it really has some nice features in r6. but using extmgr you loose everthing like user/location selection. it would be nice to gain access to this dialog. but that wish is maybe far from being realistic.
There are other issues as well, but only minor ones you can easley work around.
Markus Seitz