This is required for users who have 2-factor authentication enabled, and is generally safer because users don't need to give their password to third-party software.
`doAPI`'s `context` does not work due to `WithContext` immutability.
`Authenticate` and `RegisterApp` does not use `context` although they
needs `context`, so their `context` does not work also. This commit fixes
them and add test cases.