google / gtm-oauth2

Google Toolbox for Mac - OAuth 2 Controllers
Apache License 2.0
125 stars 70 forks source link

"Don't ask for code again" for two factor auth is not working #74

Closed JonasGessner closed 8 years ago

JonasGessner commented 8 years ago

I'm using the iOS view controller for sign in and the option to not ask for the code again when signing in with two factor auth is no being remembered. Could it be caused by the cookie swapping? I'm not sure what the cookie swapping is for, I just saw that the GTMOAuth2ViewControllerTouch does some custom cookie handling.

thomasvl commented 8 years ago

Not sure I'm following. When you create the ViewController, you can provide a keychain item name to also have it save under. Then when your app next starts you can reload the credential to avoid having the user log in again. It sounds like you might be triggering the VC each time instead of saving to the KeyChain and reusing the credentials?

JonasGessner commented 8 years ago

Yeah, I'm doing that, but what I mean is when you sign out and then sign in again (something I do during testing) the log in website asks for two factor auth codes every time, even when you've previously selected that it shouldn't ask for codes again.

thomasvl commented 8 years ago

yea, there used to be support to control this, but it end up being confusing in most cases, so it now always does the clear. Seems to end up being the most correct for the end user case, but it is a little annoying during development.

JonasGessner commented 8 years ago

OK, thanks for the info!