Top Banner
Authentication at the edge Toru Maesaka | Software Engineer, Fastly
40

Next-gen API authentication

Apr 16, 2017

Download

Technology

Fastly
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Next-gen API authentication

Authentication at the edgeToru Maesaka | Software Engineer, Fastly

Page 2: Next-gen API authentication

“The Fastly API is a RESTful API that supports all features available through the Fastly user interface”

Page 3: Next-gen API authentication

Fastly API

• Customize how you interact with Fastly

Page 4: Next-gen API authentication

Fastly API

• Customize how you interact with Fastly• Integrate Fastly with your system

Page 5: Next-gen API authentication

Fastly API

• Customize how you interact with Fastly• Integrate Fastly with your system• Programmatically control Fastly

Page 6: Next-gen API authentication

Fastly API

• Customize how you interact with Fastly• Integrate Fastly with your system• Programmatically control Fastly• Do less with Automation

Page 7: Next-gen API authentication
Page 8: Next-gen API authentication
Page 9: Next-gen API authentication
Page 10: Next-gen API authentication

Recap: Fastly API key

• Available to all customers

Page 11: Next-gen API authentication

Recap: Fastly API key

• Available to all customers• One key per customer

Page 12: Next-gen API authentication

Recap: Fastly API key

• Available to all customers• One key per customer• Use by including in Fastly-Key reader

Page 13: Next-gen API authentication

Fastly API key limitations

• Key rotation can cause downtime

Page 14: Next-gen API authentication

Fastly API key limitations

• Key rotation can cause downtime• Role based access control is not available

Page 15: Next-gen API authentication
Page 16: Next-gen API authentication

Recap: Fastly API key

• Key rotation can cause downtime• Role based access control is not available• Affects everyone in the organization

Page 17: Next-gen API authentication
Page 18: Next-gen API authentication

We’ve had lots of

feedback

Page 19: Next-gen API authentication

And we’ve listening

Page 20: Next-gen API authentication

API TokensDesigned to solve API Key limitations

Page 21: Next-gen API authentication
Page 22: Next-gen API authentication

API Tokens

• API Tokens are available per user

Page 23: Next-gen API authentication

API Tokens

• API Tokens are available per user• Users can create multiple tokens

Page 24: Next-gen API authentication

API Tokens

• API Tokens are available per user• Users can create multiple tokens• Two-factor Authentication

Page 25: Next-gen API authentication

API Tokens

• API Tokens are available per user• Users can create multiple tokens• Two-factor Authentication• RBAC / Token Authorization

Page 26: Next-gen API authentication

API Tokens

• API Tokens are available per user• Users can create multiple tokens• Two-factor Authentication• RBAC / Token Authorization• Zero downtime token rotation

Page 27: Next-gen API authentication

Token Authorization

• Just the right amount of power

Page 28: Next-gen API authentication

Token Authorization

• Pinning a Token to a Service

Page 29: Next-gen API authentication

Token Authorization

• Pinning a Token to a Service ✔

Page 30: Next-gen API authentication

Token Authorization

• Authorization Scope

Page 31: Next-gen API authentication

Scope Description

api-key Same access level as an API Key (default)

purge Purge with surrogate-key and URL

purge_all Purge an entire service

Page 32: Next-gen API authentication

Creating a token

POST /tokens

curl -H “Fastly-OTP: 123456” \ -d “[email protected]&password=$SECRET” \ -d “name=purge_token” \ -d “scope=purge” \ https://api.fastly.com/tokens

Page 33: Next-gen API authentication

Creating a token

POST /tokens

curl -H “Fastly-OTP: 123456” \ -d “[email protected]&password=$SECRET” \ -d “name=purge_token” \ -d “scope=purge” \ https://api.fastly.com/tokens

Page 34: Next-gen API authentication

{ “id”: "5YvQH3Rg4bPPkhvPC6WFm2", “user_id”: "1dZ0KVnlsFXc3ZiW9hsAb3", “access_token”: "a103bb87a7b4c71ff932f871dd19dabc", “service_id”: null, “name”: "Fastly API Token", “scope”: "api-key" “created_at”: 2016-06-21T23:04:20+00:00" }

Page 35: Next-gen API authentication

{ “id”: "5YvQH3Rg4bPPkhvPC6WFm2", “user_id”: "1dZ0KVnlsFXc3ZiW9hsAb3", “access_token”: "a103bb87a7b4c71ff932f871dd19dabc", “service_id”: null, “name”: "Fastly API Token", “scope”: "api-key" “created_at”: 2016-06-21T23:04:20+00:00" }

Page 36: Next-gen API authentication

Revoking a token

DELETE /tokens/self Revokes a token used in the request

DELETE /tokens/:id Revokes a token based on token id

Page 37: Next-gen API authentication

Other features

GET /tokens/self Get basic information about the token

GET /tokens List a user’s provisioned tokens

GET /customer/:id/tokens List all tokens associated to a customer (for superuser)

Page 38: Next-gen API authentication

Where to from here?

Page 39: Next-gen API authentication

Documentation available at:

• https://docs.fastly.com/api/auth

Page 40: Next-gen API authentication