Two Factor Authentication without CLI#82
Open
Harryacorn2 wants to merge 3 commits intommohades:masterfrom
Open
Two Factor Authentication without CLI#82Harryacorn2 wants to merge 3 commits intommohades:masterfrom
Harryacorn2 wants to merge 3 commits intommohades:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).,