In pursuit of some simplified APIs and RDF usage I’ve been dabbling with some simple command line proof of concept lark in node.
With this, I obviously came a cropper upon the auth mechanism, which has proved problematic on MacOS to say the least.
You can see the full (super POC, unstable, still pretty horrid code) lib here,(which is still not working against prod) but the specific of the workaround are thus:
Using url registration for apps means we have to abide by how MacOS opens these apps. And it does that not in a command line/script fashion (which is how windows/linux operate), but by executing the target and passing a native MacOS event to it with the URL as a param, (an event which you can’t pick up in a script… at least not in any simple fashion I found).
The application simply punts on the URL received to the target script. (You need an applescript viewer to read this, but it just does a shell execute of a neighboring
The last step is moving/renaming our fake app, to the location registered upon build. And so far, this works!
CLI auth via browser on MacOS!
edit: I forgot above, but this is using a modified