code: func (a *Authenticator) Login() error {
  	a.lock.Lock()
  	defer a.lock.Unlock()
  
  	err := a.ensureInitialized()
  	if err != nil {
  		return err
  	}
  
  	// Remove any cached tokens to trigger full relogin.
  	if err := a.purgeCredentialsCacheLocked(); err != nil {
  		return err
  	}
  
  	if !a.baseToken.provider.RequiresInteraction() {
  		return nil // can mint the token on the fly, no need for login
  	}
  
  	// Create an initial base token. This may require interaction with a user. Do
  	// not do retries here, since Login is called when the user is looking, let
  	// the user do the retries (since if MintToken() interacts with the user,
  	// retrying it automatically will be extra confusing).
  	a.baseToken.token, err = a.baseToken.provider.MintToken(a.ctx, nil)
  	if err != nil {
  		return err
  	}
  
  	// Store the initial token in the cache. Don't abort if it fails, the token
  	// is still usable from the memory.
  	if err := a.baseToken.putToCache(a.ctx); err != nil {
  		logging.Warningf(a.ctx, "Failed to write token to cache: %s", err)
  	}
  
  	return nil
  }
docs: // Login perform an interaction with the user to get a long term refresh token
  // and cache it.
  //
  // Blocks for user input, can use stdin. It overwrites currently cached
  // credentials, if any.
  //
  // When used with non-interactive token providers (e.g. based on service
  // accounts), just clears the cached access token, so next the next
  // authenticated call gets a fresh one.