OCTO-Refcard API Security BD
OCTO-Refcard API Security BD
Principles
AUTHCODE OIDC Oauth2 IMPLICIT OIDC Oauth2
Security issues arise as soon as work begins on an API, but not necessarily in the way
you might think. Commonly held beliefs often turn out to be unfounded when it comes
to API security.
Poorly designed API security leads to misuse or, worse still, to nonuse by the intended
It’s me, it’s ok It’s me, it’s ok
clients — application developers.
To facilitate and accelerate the design and development of your APIs, we’re sharing our vision and
Ok! Here’s a code Ok! Here’s a token beliefs with you here, in this Reference Card. Our insights were gained from our direct experience
on API projects.
Securi+y
A sound API security strategy rests upon 3 main pillars:
ou must authenticate the people and programs accessing your API, thus establishing trust in
Y
the identity of that person or program.
ou should explicitly authorize users and programs to perform certain tasks on your API. API
Y
Principles
authorization lists which programs are allowed to do what for which user.
You should trace calls made to your API in order to ensure the accountability of all parties involved.
This is a topic in and of itself and is not the matter of this document.
Here’s a token
Your API Security strategy must also strike the right balance between safety and usability. In
setting up obstacles to deter malicious users, you’re impeding legitimate users as well. Using
open standards often helps in finding balance because the obstacles that are known to work well
to keep out malicious users are also easily overcome by legitimate users, provided they have the
right documentation.
Strengthening security is increasingly difficult and decreasingly efficient, so remember to measure
your efforts against the actual risks.
WWW.OCTO.COM
Very secret
WE KNOW that the Web infiltrates a token
as it allows to quickly build new GUIs for upcoming
AND
Implementation
our work on APIs. Please check out our blog http://blog.octo.com,
Download OCTO's AR app. Scan pages illustrated with
and feel free to comment/challenge this API Security cookbook.
the smartphone icon to get our content with an added
We’re really looking forward to sharing with you.
augmented reality experience.
While many API Management solutions offer embedded OIDC/OAuth2 options, we advise uth0: Cloud - Support all the OIDC/OAuth2 flows
A
against them as most of the time they usually only support the “Client Credentials” flow. We Anvil: On premise - Support “Implicit” and “AuthCode” flows
prefer dedicated solutions, such as... AUTHORS
tribu-woapi@octo.com
Powered with by Florent Jaby, Antoine Chantalou, Simon Renoult, WOAPI
Tribe & Sophie Delronge.
WWW.OCTO.COM
Which security Recommended OAuth2 Scope
protocol ? protocols With OAuth2, you should recognize 3 different types of clients: In OAuth2 and OpenID Connect, an access token is bound to a set of scopes.
A scope describes the limits of the privileges that a user has delegated to an application.
Confidential: For applications consuming your API. Usually server- or web-based applications
It usually looks like: “profile”, “email”, “articles”, “publish”, etc.
OPEN ID
Do not use.
External: Typical third-party web-based clients. Can keep their secrets safe A user can only delegate privileges he or she has.
API KEY
CONNECT Public: Mobile and Single Page applications. Their credentials cannot be safely stored
BASIC AUTH
Protocol decision tree
should I use? A SCOPE MUST NOT REPLACE HOW USER PRIVILEGES ARE DESCRIBED
Is an end-user
Basic auth sends your secret to the network with HTTPS connected?
Claims .
No expiration control
Shared secret unsuitable for web pages and mobile apps
No standard for secure secret exchange
Bearer tokens are best used in a OAuth2 context, attached to an authorization scope, a user, and
when made easily renewable.