OAuth 2.0: Benefits and use cases — why?

Background: I’ve written client and server stacks for OAuth 1.0a and 2.0. Both OAuth 1.0a & 2.0 support two-legged authentication, where a server is assured of a user’s identity, and three-legged authentication, where a server is assured by a content provider of the user’s identity. Three-legged authentication is where authorization requests and access tokens come … Read more

SMTP and OAuth 2

System.Net.Mail does not support OAuth or OAuth2. However, you can use MailKit‘s (note: only supports OAuth2) SmtpClient to send messages as long as you have the user’s OAuth access token (MailKit does not have code that will fetch the OAuth token, but it can use it if you have it). The first thing you need … Read more

OAuth2 and Google API: access token expiration time?

You shouldn’t design your application based on specific lifetimes of access tokens. Just assume they are (very) short lived. However, after a successful completion of the OAuth2 installed application flow, you will get back a refresh token. This refresh token never expires, and you can use it to exchange it for an access token as … Read more

How can I use Django OAuth Toolkit with Python Social Auth?

A lot of the difficulty in implementing OAuth comes down to understanding how the authorization flow is supposed to work. This is mostly because this is the “starting point” for logging in, and when working with a third-party backend (using something like Python Social Auth) you are actually doing this twice: once for your API … Read more