If we switch to a `GTCredentialProvider` type as described above, this logic could be encapsulated in a method upon it.