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

Two Factor Authentication without CLI #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Harryacorn2
Copy link

Added functionality for OTP to be provided by a callback function instead of the CLI for use in headless applications. Simply provide a callback function that returns a string as the optional "otp_func" parameter when calling "get_access_token". If two factor authentication is required, your callback function function will be run, and the string it returns will be used used as the OTP. If your function returns a string that is not valid (if it has less than 6 characters or if they're not all numbers) the function will be run repeatedly until a valid string is returned by it (similar to the functionality of the CLI).,

I am testing if commits work the way I think they do
You can now pass a function to get_access_token so that when it needs the OTP it calls your function instead of using the CLI. Your function should take no parameters, and should return a string.
Now if the string provided by the external function isn't a valid code (at least 6 characters and all digits) it runs the external function again, the same way the CLI version does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant