wstrange / GoogleAuth

Google Authenticator Server side code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are GoogleAuthenticator methods thread safe?

roytmana opened this issue · comments

Hi @wstrange

Sorry for posting an issue I could not find any other place to post my question but I was wondering if GoogleAuthenticator methods are thread safe particularly getTotpPassword() and authorize()

BTW google drive folders where pre-built docs should be are all blank

thanks
Alex

Hi,

The class is not thread safe. However, if you don't use the credential repository feature, the rest of the methods are. But since the contract says otherwise, you shouldn't rely on it.

I just checked that folder using a Chrome incognito window and I see the documentation.

@emcrisostomo thank you for the input. I do not use repository but would like to stick with the recommended approach. Is cost of instantiating/initializing authentication sufficiently small to make per invocation instantiation the recommended strategy?