Macpass: Global Autotype working?

Created on 8 Dec 2014  Â·  53Comments  Â·  Source: MacPass/MacPass

As far as I understand, with global autotype, I am supposed to browse (Chrome) to a URL, press Ctrl-Alt-M and autotype will work. This at least is how I work in Keepass for Windows.
It does not work for me (MacPass 0.5.1, Yosemite 10.10.1). Enable global-autotype is on and the shortcut is there (though on a separate note -- it cannot be replaced right now)
I have some (rusting) dev capabilities and xcode installed if you want me to debug something.

All 53 comments

I have the same issue and was just about to write something.
Also on Chrome, with OSX 10.9.5.

I have tried setting the global hotkey to something different, but to no avail.

In this regard - some feedback on autotype operations (status bar, or OSX message popup?) would be nice

@yarongol You're correct in your understanding of Autotype. There is however now visual guide if auto type is initiated and has not found any matches.

What you could check out to clarify if auto type is working:

  • 0.4.x did wrongfully store a bad default auto type sequence {TAB}{USERNAME}{TAB}{ENTER}. Use File > Fix Autotype to clear those out. The default should be {TAB}{USERNAME}{TAB}{ENTER}
  • create a new database, create an entry.
  • set the title to "untitled" and enter a username.
  • now open e.g. TextEdit and open up an Untitled document. Press the hotkey and you should see the username, a tab and the password, and a return being entered.
  • you might add a copy of this entry and redo the steps again, now you should see a prompt that ask you what entry to select for auto type. If none of this works, debugging is needed (see below).
  • the auto type key stroke is editable. Just click in the text input and press and hold the shortcut you want to use. The shortcut hast to have a non modifier key.

For debugging:

  • go to MPAutotypeDaemon.m and set a breakpoint on line 111 in _didPressHotKey. If you get to this, at least the hotkey did register. After that you can step trhoug the code to see where the lookup fails.

Another note. Autotype currently only looks at the title. URL, Host or Tag lookup as Keepass does it aren't considered yet.

I just reproduced your usecase, and it works.

It took me a while to notice that you indeed meant the title of the database entry and not the Autotype->Window Title field.

The window title works too in master as editing is working now. This is will be introduced with 0.5.2 in the binary release.

OK. The Window Title did it. Thanks.
In Windows I heavily rely on keepass Windows associations and my "Title" entries are many times unrelated to the chrome window. I found that Windows Associations tend to be more resilient to website changes but more importantly: they are needed when a single sequence is used for many pages (mostly in corporate scenarios for intranet access)

Another thing I noted is that autotype sequences with custom fields are not working. e.g. {USERNAME}{TAB}{PASSWORD}{TAB}{S:Custom 3}{ENTER}. Might be worth mentioning in the status page.
Setting the actual data within the sequence DOES work. e.g. {USERNAME}{TAB}12593{TAB}{PASSWORD}{ENTER} which is a reasonable workaround

Taking the opportunity to thank you for this great tool.

Thanks for the clarification. Regarding the custom attributes not being evaluated, there was a bug with lower/upper case lookup but it should actually pick them up in 0.5.1 already. I've found and fixed some bugs in master so if you're able to check that out and test if it's working, that'll be great. Another thing that did not work properly was the command lookup for lower case special key presses. My test case only covers lower and upper case mixup in placeholders ;)

Did a git pull and ran. I don't think its fixed. I actually created a movie and got the picture of the custom field being inserted:
image

Note that the custom field name is {W: Custom 3} the " 3" was not inserted. Maybe this is the problem

This might be a bug from trying to roll out repetitions. Keepass allows you to do something like this {TAB 3}. MacPass normalises this to {TAB}{TAB}{TAB}. So a custom field with a blank might have the described effect.

And I just checked Keepass. Seems that repetitions are only valid for key press commands. Oh well. There's some work to be done. Nice catch!

Hi. I don't seem to be able to get AutoType to work. I'm not a developer, but at least a savvy user. I tried on an existing database and using a new database as you describe above.

I tried changing the keyboard shortcut. I tried shutting down every other program I could think of that registers global shortcuts. Nothing worked. Any ideas on what I could do to troubleshoot or test?

I don't know if this is related, but when I go to Fix Autotype, there are NO entries in the window. It's blank.

I am using the latest version of MacPass - 0.5.1 - on OS X Yosemite.

Thanks.

Sadly the hotkey registration seems a bit flacky. Or at least there are some edge cases I'm not handling well. What you can do to visually get a clue if the auto type key shortcut is actually working is lock the database and then activate another app. Then press the hotkey. MacPass should come to the foreground and present you with the lock screen.

And again, Autotype is still very immature. There are so much features Dominik did add to this in KeePass that it's quite a job to just get on the same level. And some are actually quite tricky to get to work right ;). Not an excuse. Just an attempt to explain the weird stuff.

@miscreanttoucan any luck trying auto type with a locked database?

So this is odd. Sure enough, if the database is locked, and I hit the auto type shortcut, the OS switches to MacPass. But when I'm NOT locked, the shortcut does nothing. I select an entry, hit the shortcut, and nothing happens. If I put my focus in a browser window and hit the auto-type shortcut, nothing happens. Anything I should try?

@miscreanttoucan You might have the wrong impression how auto type works. Keepass supports two modes. The simple Autotype and the more sophisticated Global Autotype. MacPass currently only has a rudimentary version of Global Autotype working. If you want to dive in, take a look at the Keepass Autotype Help

To summarize (and perhaps explain your observations) the process:

You do
open MacPass and enable global auto type.
go to a login page in your browser.
put the cursor in the user text input and press the Global Autotype shortcut.

MacPass does
MacPass tries to find entries that match to the current situation. How? When Autotype is activated, the window title of the front most application is used to search through all the titles of entries and all window associations. An entry matches, if the window title contains the entrie's title. (e.g. you got to www.amazon.com and your entry title is Amazon). A window association is more complicated, as they allow for simple wild cards or even regular expressions. If only one match is found, the Autotype sequence from this match is executed. If there are multiple matches, Autotype shows you a dialog and then exectutes the one you selected.

The simple example I gave with TextEdit works the same way. The Untitled document results in a search for any entry that contains "Untitled" in it's title.

If you see MacPass being activated chances are, there is no match and hence nothing happens when you press the shortcut.

Note
Another problem might be, that MacPass is unable to determine the title of the window of your browser. What browser are you using?

A simple test that works for me on Firefox, Safari and Chrome.

  • Create an entry. Set it's title (NOT username) to google
  • Set it's auto type Sequence to let me {TITLE} that for you{ENTER}
  • lock the database
  • open your browser and go to www.goolge.com
  • click in the search field
  • press the Autotype hotkey.
  • unlock the Database when MacPass activates

After that, your browser should be put to the front again and the search field will be filled with let me google that for you and then submitted.

@yarongol
I've come around with a solution for the problem of spaces in custom field names. Currently MacPass even can work with receptions of placeholders since it's a generalised approach. That did iron out some kinks. Another thing is, MacPass plainly rejects Autotype sequences with wrong bracket combinations. The only two accepted "non-matching" commands are {{} and {}}. Internally I map them to {CURLYLEFT} and {CURLYRIGHT} that results in valid bracket counts.

I'm familiar with how KeePass on Windows works, but I may not be using it to it's full capability. Here's what I do in Keepass on Windows (and what I was trying in MacPass):

  1. Open the login screen in a browser. (example: http://www.website.com/login). Put cursor in first field.
  2. Find the record in KeepPass. Hit Ctrl V.
  3. KeePass switches back to the browser (as if I'd hit control-tab), types the username, tab, the password, and hits enter.

I was trying to do the same thing in MacPass. I guess this isn't suppose to work? It would be pretty nice if it did. Also consistent with KeePass.

Your thoughts?

Also, I was able to make autotype work on a website where the titles matched, so that's good. But I find this method very cumbersome because it requires carefully trying to make a record match a website. The website then changes, autotype doesn't work, uggh. I like my workflow better because it always works. I just find the record in my password database and one keystroke has me logged in.

In other news, I did have an instance today where MacPass stopped responding to the autotype. The program was locked but didn't gain focus. Restarting the program made it respond again. Not sure what that was about.

Nice. Than that's correct. The version your using is not implemented yet as I wanted to get the complicated one working first. The simple solution via Ctrl-V on windows should be added as well in MacPass, that's a given and if the Hot key invoked one works, the other one is not that hard to add. Haven't come around to it yet as I like the other one better :). Tastes. Glad we could sort this out (regarding the why and why not). On the bug - I might add some more log messages so we can track them down more easily.

Would it be helpful to file a feature request then? BTW, I'd really be happy to help with testing. I'm pretty good at spotting problems, inconsistencies, etc and articulating them. I really appreciate the project. I've wanted a good KeePass implementation on the Mac for a long time.

Done. #288

Hey,

Just verifying I'm not missing a working feature somehow. After reading this thread and some change logs, it looks like global auto-type is partially functional. I am able to use the 'title' field and 'autotype sequence' field and it works with global hot key.

Is the known not functioning part as of 0.5.1 (current latest release) the window associations, window title, and window sequence fields?

In my keepass use case, I use global auto-type heavily. It would almost work here in 0.5.1, except the vast majority of my entries the 'title' field is for my own personal use and identification of that entry, rather than the window title of the page I want to log into. In keepass, I used the "Auto-Type-Window" command for each entry to flag the actual window title. Unfortunately for me, I have hundreds of entries and using 'title' to represent the window title will make it difficult to identify my own database entries, because I have no control over the window title some website chooses to use.

Other than this one feature, macpass has been great so far! It's this one last global auto-type with "separate" control over window title from entry title that is really the only missing piece for me.

+1 for supporting "Auto-Type-Window".

Also, it would be great if user got some visual feedback about "no matching entry found" when hitting global hotkey. Something like the popup/tooltip that displays "Username copied!" would be awesome here.

For my system (OSX 10.10.3) there is still a problem in the current master concerning autotype. The last 0.5.1 alpha (2556) works like a charm, but the last master releases always lower-case the first letter of the password thus leading into a faulty password... Passwords with a lower-case letter in the beginning actually work.

The auto type code had a lot of bugs and misbehaviours fixed, so this might be a result of them. My tests work, guess I should add one that tests for lower/upper case in passwords :)

One issue I've run into using autotype is that sometimes I also have a password saved in my browser, and it will also autofill the password on the {TAB} that switches from the username field to the password field, and the password will be typed twice and the login will fail. In order to get around this, I need to use an autotype sequence of{CLEARFIELD}{USERNAME}{TAB}{DELAY 20}{CLEARFIELD}{PASSWORD}{ENTER}. (The delay is to give the browser tome to complete its autofill. It's probably a race condition, and I have no idea of what the appropriate delay is.) Is there any way I can make this default for all entries instead of manually editing each one? (Alternately, can something like this become the builtin default autotype? Those CLEARFIELDs make it a lot more robust, in case you started typing the username before remembering to use autotype.

I plan to add the setting to specify the default auto type sequence. Until then you can edit the sequence in the root group. The default behaviour is to inherit the sequence an thus all new entries and groups will get the one from the root group.

I will however not change the default to comply with the Keepass' defaults.

Changing the autotype sequence on the root group is perfect. Thanks.

Hey, I'm a bit confused if the Ctrl-V autotype style functionality is working or not? I can't seem to get it working if it is...

Awesome work by the way, looks nicer than the original ;)

Could please someone check if autotype still works in 10.12 (Sierra)?
I somehow could not manage to see it working.

I used global autotype today on Sierra and it worked fine.

I think this feature lacks a clear "how to". I spend the last 1 hour to understand how it should work..
Does a KeePass Entry URL have to match the current URL in browser? Or how does it match the entry?

I also enabled the preview, but do not see any preview on the screen whether it has found the entry or not.
shortcut is ctrl+alt+m right?

Edit: In autotype preferences, the option "include title for matches" (selected as default) is used for match option i think.. "include" is confusing..

but autotype still does not react..

I tend to forget that MacPass is used by users not knowing KeePass for windows and the features. This yields the missing documentation for a lot of features of MacPass.

I starte a wiki page for Autotype to explain the concept and will try to fill in the blanks ASAP.

Thank you very much Michael. I actually found out and read a bit of the KeePass Autotype Documentation. I somehow still miss another small point..

Edit: Thank you for your fast reaction btw. Thank your explanation, i have found out that the simple version autotype (Perform Autotype) works. I think the problem with the global autotype is that the keystroke (ctrl+option+m) does not somehow trigger the macpass (although it is selected in the macpass preferences). Should i also define this shortcut in mac->preferences->keyborad shortcuts for the macpass app?

Edit: I think it also worths to mention whether the macpass must be open in background and the database must be unlocked in order the global autotype works.

Autotype

Thanks for the Autotype wiki page. It will be super helpful for people who are new to KeePass.

As one of those people, I have a question about it: I don't quite understand at the end of the last section why Entry A is used. Based on the explanation, I would expect Entry B to be used. I could be misunderstanding, though.

There are a couple of typos in the wiki as well. If you want, I can also proofread the page.

Control sequences

Can you make a wiki page with a table of all the control sequences and what they do? (e.g. {TAB}, {ENTER}, etc.) Is there, for instance, a {WAIT:10} control or other features I just wouldn't know about? I can open a new issue if you'd prefer.

@akcasoy I have encountered some cases where the hotkey is not triggered correctly. Sometimes enabling and disabling global autotype fixes that. I should investigate this further. MacPass of course must run but the database can be locked. If you invoke autotype and all databases are locked, MacPass will print you to unlock at least one. If you do not unlock the database containing the required entry and another one is unlocked, autotype will fail as it's not asking for all databases to be unlocked. MacPass always reports feedback when autotype was invoked even if no match was found to be able to see if the keystroke worked. You do not need to add the hot key to the system preferences.

@michaelblyons you are right, the match is B. The last sentence was wrong. For the available keys you can take a look at the KeePass website. Not all are supported but quite a few. I tend not to try to replicate the KeePass documentation but it is quite useful to know what is actually supported and what isn't. The command to wait is {DELAY <seconds>} and MacPass should support it if I did not break it ;-). Feel free to proof read. I'm happy about any help that is offered! The wiki page should be editable for anyone.

Wouldn't it be better to match on URL first since it is more likely to
be more accurate as Titles can be fairly 'loose' and ill-defined?

With the 'which database has the password', how about Macpass asks which
databases from the recently used list?

On 10/11/16 07:39, Michael Starke wrote:

@akcasoy https://github.com/akcasoy I have encountered some cases
where the hotkey is not triggered correctly. Sometimes enabling and
disabling global autotype fixes that. I should investigate this
further. MacPass of course must run but the database can be locked. If
you invoke autotype and all databases are locked, MacPass will print
you to unlock at least one. If you do not unlock the database
containing the required entry and another one is unlocked, autotype
will fail as it's not asking for all databases to be unlocked. MacPass
always reports feedback when autotype was invoked even if no match was
found to be able to see if the keystroke worked. You do not need to
add the hot key to the system preferences.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mstarke/MacPass/issues/279#issuecomment-259520268,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcCs0ZI5DyM8dMBGhcwkMyVtPhWVGvpks5q8i-OgaJpZM4DFijs.

@oehm-smith might be but I try to stay compatible with KeePass and KeePass matches in that order.

That makes sense.

On 10/11/16 22:23, Michael Starke wrote:

@oehm-smith https://github.com/oehm-smith might be but I try to stay
compatible with KeePass and KeePass matches in the that order.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mstarke/MacPass/issues/279#issuecomment-259666376,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcCs6Jk6IPD-A_2GyTRRWopfSjiobP6ks5q8v7LgaJpZM4DFijs.

Global Autotype does again not work for me.

Wenn I evoke the keyboard-shortcut nothing happens. Window Titles, and URL match at least 1 pattern in my Database.
The Mac Console raises an entry with the message "An uncaught exception was raised" as well as two more entries with messages "private". Not very enlighting, but I can't seem to find anything more in the log-files.
I'm currently working with the binary version 0.6.2 (12420).

Thanks in advance!

There where numerous bugs with autotype and those should be fixed in the current master. Those fixes will be available in 0.7 as well.

Thanks for the quick response! So are you suggesting I should built from source or is 0.7 to be released soon anyway?

Is .7 going to be released? It's still clear how to get auto-type working. What does "Title" even match? Can someone post an example that works for them? Will autotype work in iTerm2 or just a browser?

0.7 is coming eventually. I will release 0.6.3 within the week to fix major bugs but without a complete 0.7 feature set.

Autotype works for any app ( via context menu or shortcut when MacPass is the front most app) as well as global Autotype (hotkey based autotype when MacPass is in the background) since it relies only on the window title of an app.

I've worked with a compiled pull from GitHub which i suppose is 0.7 and on my macOS Sierra with Safari Global Autotype return the wrong Window Title. I think it returns the wrong window / process in focus as it always searches for some window called Focus Proxy.
With Firefox it's the same. Though sometime the wrong tab title is returned

Happy Easter by the way

There have been more fixes to the Autotype system regarding wrong windows titles (focus proxies, and the lot) that should make the system more robust and usable. Could any of you try the continuous build to see if this fixes the reported issues?

I have just built the current master from source. Global autotype appears to work as expected. A couple of remarks:

  • checking Enable global Autotype in the preferences does not immediately enable global autotype: I had to quit and re-open MacPass to have it working;
  • matching (in browsers) uses only the title of the web page (as it appears in the <title> tag), even if other options are checked in MacPass's preferences (I think this is mentioned somewhere else in this thread). For other apps, it uses the app's name.

I have tested it with Safari, Firefox, and the App Store app.

Thanks for the feedback. You should be able to use the continuous build as it represent the current master, so no need for a custom build.

  • There were a couple of hiccups with the hotkey registration. I have to check and see if I can iron out the one you reported as well.
  • Autotype is a generalises approach for matching entries based on window titles. This way you get App names, Document names or URLs or titles for websites since the browser most of the time sets the window title to the html title attribute. What you refer to in the settings is a misunderstanding and I just updated the labels for the settings. Those settings have no effect on what is used from a browser window. MacPass only sees window titles, nothing more. Those setting refer to the field of an entry. Normally only the title attribute is matched but it's adjustable via the settings for your needs. The system gets more flexible if you also include window associations, as those allow you to add custom criteria for special cases and support wildcards and regular expression matching. If you want to get into the details of the autotype matching system, you should take a look at the documentation for KeePass.

If you got any questions, just shoot.

I just checked for you first observation and am unable to see this. My steps:

  • Disabled Autotype
  • Quit MacPass
  • Started MacPass
  • Enabled Autotype
  • Pressed Hotkey
  • -> System worked.

Did you unlock the database? If the hot-key is pressed while no database is unlocked, MacPass should pop to the foreground and you have to unlock the database.

I just checked for you first observation and am unable to see this

You are right, I cannot reproduce it either.

MacPass only sees window titles, nothing more. Those setting refer to the field of an entry.

Thanks for clarifying that. In fact, I had got it wrong.

Hey guys, a fresh Macpass user here. I don't have a problem anymore but something I encountered and wish to share with you. I had set my Autotype key sequence to ALT-SHIFT-A on my Mac and this never triggered the Autotype function. Switched the sequence to CTRL-SHIFT-A and things started working for me. Thank you for a great product.

Specs are:
MacBook Pro (Retina, 15-inch, Mid 2014)
MACOS 10.13.1
MacPass Version 0.7.1 (20171118111152-continuous)

@roland-d Considering your issue: The default shortcut for autotype (not Global autotype) is Alt-Shift-A so this might clash.

@mstarke Ah thanks for that explanation. I am now used to the CTRL-SHIFT-A :)

I'm closing this since the actual issue seems to be fixed.

Was this page helpful?
0 / 5 - 0 ratings