OAuth 2 - Security Best Current Practices

Some notes from a couple of really quick presentations regarding OAuth 2.0, it went really fast thus challenging to note things down; hopefully will set the path to develop the topic further with this as a starting point.

Best Current Practices

I got a couple of them —BCPs for short— to start with, around some of the traditional flows:

Furthermore, the use of the following flows is discouraged:

More on the Password Grant, an excerpt from Okta

The Password grant is used when the application exchanges the user’s username and password for an access token. This is exactly the thing OAuth was created to prevent in the first place, so you should never allow third-party apps to use this grant.

Machine-To-Machine Flow

Backend-2-Backend is usually where I usually dwell therefore found quite interesting flows such as On-Behalf-Of as the means for authentication/authorization; there were of course some advice for authentication in particular:

Another good advice was to always include the ‘typ’ header attribute, to properly identify a JWT token and not be confused as any other token type:

{
  'typ': 'at+jwt'
  ...
}

That identifies the token as JWT Token, preventing applications confusing them with other types. Other interesting concepts that were brought up during the sessions are listed below:

And finally, some tools mentioned and used during the session: