Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run 'headless' ? #24

Open
dzg opened this issue Apr 5, 2020 · 3 comments
Open

Run 'headless' ? #24

dzg opened this issue Apr 5, 2020 · 3 comments

Comments

@dzg
Copy link

dzg commented Apr 5, 2020

Is there any way to run the chrome session headless like with https://github.com/mrooney/mintapi ?
Thanks

@dhleong
Copy link
Owner

dhleong commented Apr 6, 2020

We do not support it currently, no. Not reliably, at least.

I believe the way they do it is by connecting to your email account, which is kinda out of scope right now. I would probably not be opposed to a PR for this, but I have no plans to work on that any time soon.

@ScottG489
Copy link
Contributor

Hey @dhleong. Do you have any idea on how this may be accomplished? Any ideas or background you have would be helpful :) I may be interested in adding support. I used to use this in a headless fashion and it was really nice.

@dhleong
Copy link
Owner

dhleong commented Oct 17, 2020

@ScottG489 Not really; Mint changed their authentication mechanism some time ago in a way that broke the old means of headless auth. If you want to incorporate a more headless mechanism into this lib, or an external lib that can work together with this one, your best bet is to look through the repo @dzg linked above and see how they do it.

If you have a CLI app then you may be able to prompt users for their 2FA code and just launch the browser in headless mode instead of how we're doing it here, and feed that input into the 2FA form. If you have a web app, it may be more tricky to accomplish this flow. If you have some sort of personal integration, you could build some support for scanning your email provider using IMAP for the 2FA code and feeding the 2FA form from that. I'm not a huge fan of this path, because IMAP is less secure than normal mail access (it doesn't support 2FA, so for Gmail, at least, you have to create an app-specific password which Google will nag you about having periodically... because it's not very secure) but if you're comfortable with the risk then by all means.

Since the Typescript refactor, the internals are a bit more amenable to new auth mechanisms, but for backwards compatibility the public API is still a bit weird. If you'd like to build an IMAP-based auth mechanism in a separate library, for example, we could expose a new means of constructing the PepperMint instance that accepts an IMintAuthorizer instance instead of email and password. The ChromedriverMintAuth is pretty straightforward, so you could base it off that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants