Skip to content

Two Factor Authentication without CLI#82

Open
Harryacorn2 wants to merge 3 commits intommohades:masterfrom
Harryacorn2:2FA-without-CLI
Open

Two Factor Authentication without CLI#82
Harryacorn2 wants to merge 3 commits intommohades:masterfrom
Harryacorn2:2FA-without-CLI

Conversation

@Harryacorn2
Copy link
Copy Markdown

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