bk99.de entertain the web since 1997

OAuth2 for Gmail on Linux and ESP8266

Summary

Hackaday explains token-based Gmail login so that scripts and microcontrollers can send email without a stored account password. Gmail documents its OAuth2 interface. The approach runs on Linux and the ESP8266.

Ideas

  • OAuth2 replaces the password with limited access tokens.
  • A refresh token renews short-lived credentials.
  • The ESP8266 calls Gmail interfaces over TLS.

Insights

  • Limited tokens reduce the damage from compromised devices.
  • Modern authentication increases setup effort and improves revocability.

Recommendations

  • Store refresh tokens encrypted and with minimal permissions.
  • Plan token revocation for lost devices.

References

Read the original article

Search the Web Archive