api introduction - api management workshop munich from ronnie mitra

239
API Workshop Ronnie Mitra Principal API Architect - Europe Layer 7 API Academy

Upload: ca-api-management

Post on 20-Aug-2015

808 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Workshop

Ronnie Mitra

Principal API Architect - Europe

Layer 7 API Academy

Page 2: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 3: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Management

virtual cloud on-premise

Page 4: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Academy

Mike Amundsen Ronnie Mitra

Page 5: API Introduction - API Management Workshop Munich from Ronnie Mitra

www.apiacademy.co

Page 6: API Introduction - API Management Workshop Munich from Ronnie Mitra

Business of APIs

API Styles

Usability

Security

API Architecture

SOA Governance

Page 7: API Introduction - API Management Workshop Munich from Ronnie Mitra

What are Web APIs?

Page 8: API Introduction - API Management Workshop Munich from Ronnie Mitra

Connecting things

Page 9: API Introduction - API Management Workshop Munich from Ronnie Mitra

Connecting computer programs

Page 10: API Introduction - API Management Workshop Munich from Ronnie Mitra

API

All programmers are API designers

Connections between modules

Language Dependant

APIs are constrained by the syntax of the language

Page 11: API Introduction - API Management Workshop Munich from Ronnie Mitra

… over the web

Page 12: API Introduction - API Management Workshop Munich from Ronnie Mitra

Web APIs

Language Independent

APIs are constrained by the syntax of the web

Most API Design principles can be applied

Some design principles are unique to Web APIs

Page 13: API Introduction - API Management Workshop Munich from Ronnie Mitra

Web of

Documents

Web of

Apps Web of

Services

Web of

Things

Page 14: API Introduction - API Management Workshop Munich from Ronnie Mitra

The web is ubiquitous

And universally accessible

Page 15: API Introduction - API Management Workshop Munich from Ronnie Mitra

Publishers retain control

Page 16: API Introduction - API Management Workshop Munich from Ronnie Mitra

We are surrounded by Web APIs

Page 17: API Introduction - API Management Workshop Munich from Ronnie Mitra

Did you check the weather today?

Page 18: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 19: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 20: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 21: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 22: API Introduction - API Management Workshop Munich from Ronnie Mitra

Private or Closed APIs

Page 23: API Introduction - API Management Workshop Munich from Ronnie Mitra

Acme Corp. API

Acme Corp. App

Page 24: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 25: API Introduction - API Management Workshop Munich from Ronnie Mitra

Public or Open APIs

Page 26: API Introduction - API Management Workshop Munich from Ronnie Mitra

Acme Corp. API

Third Party App

Page 27: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 28: API Introduction - API Management Workshop Munich from Ronnie Mitra

Priority: Lower Cost

Priority: Increased Adoption

Page 29: API Introduction - API Management Workshop Munich from Ronnie Mitra

Business of APIs

Page 30: API Introduction - API Management Workshop Munich from Ronnie Mitra

why build an API?

Page 31: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Consumer Reach

Revenue Source

Marketing

Integration

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

Page 32: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Consumer Reach

Revenue Source

Marketing

Integration

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

Page 33: API Introduction - API Management Workshop Munich from Ronnie Mitra

Revenue Source

Page 34: API Introduction - API Management Workshop Munich from Ronnie Mitra

Revenue Source

http://www.flickr.com/photos/inside-south-africa/485356704

£0.10 per API Call

Page 35: API Introduction - API Management Workshop Munich from Ronnie Mitra

Revenue Source

1000 calls/month

5000 calls/month

Page 36: API Introduction - API Management Workshop Munich from Ronnie Mitra

Revenue Source

500 calls/month

1000 calls/month

5000 calls/month

Page 37: API Introduction - API Management Workshop Munich from Ronnie Mitra

Revenue Source

Is your content worth paying for?

Page 38: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Consumer Reach

Revenue Source

Marketing

Integration

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

Page 39: API Introduction - API Management Workshop Munich from Ronnie Mitra

Consumer Reach

Page 40: API Introduction - API Management Workshop Munich from Ronnie Mitra

Consumer Reach

Page 41: API Introduction - API Management Workshop Munich from Ronnie Mitra

Head

Long Tail

Consumer Reach

Page 42: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Consumer Reach

Revenue Source

Marketing

Integration

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

Page 43: API Introduction - API Management Workshop Munich from Ronnie Mitra

Marketing

Affiliate Programs

Sometimes you pay the developer.

Page 44: API Introduction - API Management Workshop Munich from Ronnie Mitra

Marketing

Draw new visitors in.

Page 45: API Introduction - API Management Workshop Munich from Ronnie Mitra

Marketing

Page 46: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Consumer Reach

Revenue Source

Marketing

Integration

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

Page 47: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

Innovation from within

Page 48: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

Innovation outside your borders

Page 49: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

When does innovation happen?

Page 50: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Consumer Reach

Revenue Source

Marketing

Integration

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

Page 51: API Introduction - API Management Workshop Munich from Ronnie Mitra

Integration

Business driven integration

Regulatory driven integration

Page 52: API Introduction - API Management Workshop Munich from Ronnie Mitra

Observational Learning: Five Short Stories of Public APIs

Page 53: API Introduction - API Management Workshop Munich from Ronnie Mitra

2000 – ebay

Page 54: API Introduction - API Management Workshop Munich from Ronnie Mitra

Started with a paid developer program in 2000

Made it free in 2005

Page 55: API Introduction - API Management Workshop Munich from Ronnie Mitra

Consumer Reach

Marketing

Page 56: API Introduction - API Management Workshop Munich from Ronnie Mitra

Large developer eco-system Large app eco-system

Page 57: API Introduction - API Management Workshop Munich from Ronnie Mitra

25% of eBay listings come from their API!

Page 58: API Introduction - API Management Workshop Munich from Ronnie Mitra

salesforce

2000 – salesforce

Page 59: API Introduction - API Management Workshop Munich from Ronnie Mitra

Integration

Revenue Source

Page 60: API Introduction - API Management Workshop Munich from Ronnie Mitra

API as a cloud enabler

Page 61: API Introduction - API Management Workshop Munich from Ronnie Mitra

2004 – Flickr

Page 62: API Introduction - API Management Workshop Munich from Ronnie Mitra

web 2.0 generation

Page 63: API Introduction - API Management Workshop Munich from Ronnie Mitra

Consumer Reach

Marketing

Page 64: API Introduction - API Management Workshop Munich from Ronnie Mitra

The rise of self-service Announced 6 billion photos in August 2011

Page 65: API Introduction - API Management Workshop Munich from Ronnie Mitra

2006 – Amazon Web Services

Page 66: API Introduction - API Management Workshop Munich from Ronnie Mitra

Started as an online book shop… Became a department store…

now?

Page 67: API Introduction - API Management Workshop Munich from Ronnie Mitra

Jeff Bezos Connect everything

http://www.flickr.com/photos/zippy/2430495092

Page 68: API Introduction - API Management Workshop Munich from Ronnie Mitra

2004: Hey, why don’t we sell this?

Page 69: API Introduction - API Management Workshop Munich from Ronnie Mitra

Revenue Source

Page 70: API Introduction - API Management Workshop Munich from Ronnie Mitra

Estimated revenue: $1.5B in 2012

http://wikibon.org/wiki/v/Cloud_Computing_2013%3A_The_Amazon_Gorilla_Invades_the_Enterprise

Page 71: API Introduction - API Management Workshop Munich from Ronnie Mitra

Twilio or stripe

2007 - Twillio

Page 72: API Introduction - API Management Workshop Munich from Ronnie Mitra

Revenue Source

Page 73: API Introduction - API Management Workshop Munich from Ronnie Mitra

The API is the business

Page 74: API Introduction - API Management Workshop Munich from Ronnie Mitra

100,000 developer milestone in 2012

Page 75: API Introduction - API Management Workshop Munich from Ronnie Mitra

Original APIs are still successful

New business models have emerged

Different drivers have influenced API design

Summary

Page 76: API Introduction - API Management Workshop Munich from Ronnie Mitra

Why make an API Public?

Page 77: API Introduction - API Management Workshop Munich from Ronnie Mitra

Unlock new markets

External innovation

Drive revenue

“Free” development

Crowdbased asset development

Page 78: API Introduction - API Management Workshop Munich from Ronnie Mitra

Promote Mutual Gain

(Symbiosis)

Page 79: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://upload.wikimedia.org/wikipedia/commons/f/ff/Aedes_albopictus_cdc.jpg

Page 80: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://commons.wikimedia.org/wiki/File:Arothron_hispidus_is_being_cleaned_by_Hawaiian_cleaner_wrasses,_Labroides_phthirophagus_1.jpg

Page 81: API Introduction - API Management Workshop Munich from Ronnie Mitra

Don’t forget:

More developers = Higher Costs

Page 82: API Introduction - API Management Workshop Munich from Ronnie Mitra

Bandwidth

Technical Support

Processing and Storage

?

Page 83: API Introduction - API Management Workshop Munich from Ronnie Mitra

Documentation

Tools

Evangelists and communities

Supporting Developers

Connector designed by R Chow from The Noun Project

Notepad designed by Luis Prado from The Noun Project

Page 84: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Management

Page 85: API Introduction - API Management Workshop Munich from Ronnie Mitra

To ensure failure, make your API:

• difficult to understand

• dangerous to use (unsafe)

• unreliable and unstable

• opaque (provides no visibility)

Page 86: API Introduction - API Management Workshop Munich from Ronnie Mitra

API management helps us:

• Drive adoption

• Lower costs

• Keep existing users

• Reduce friction

Page 87: API Introduction - API Management Workshop Munich from Ronnie Mitra

Innovation

Consumer Reach

Revenue Source

Marketing

Integration

Light Bulb designed by Jean-Philippe Cabaroc from The Noun Project

Page 88: API Introduction - API Management Workshop Munich from Ronnie Mitra

Without API management an API is naked.

Page 89: API Introduction - API Management Workshop Munich from Ronnie Mitra

Business of APIs Summary

• Understand the business motivation

• Choose a style that fits your constraints and goals

Page 90: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Styles

Page 91: API Introduction - API Management Workshop Munich from Ronnie Mitra

What does a Web API look like?

Page 92: API Introduction - API Management Workshop Munich from Ronnie Mitra

Web APIs

HTTP

Page 93: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 94: API Introduction - API Management Workshop Munich from Ronnie Mitra

Architectural Styles

Page 95: API Introduction - API Management Workshop Munich from Ronnie Mitra

Tunnel Style

URI Style

Hypermedia Style

Event Driven Style

Page 96: API Introduction - API Management Workshop Munich from Ronnie Mitra

Tunnel Style Example: SOAP

• transport agnostic • operation based • binding documents (WSDL)

Page 97: API Introduction - API Management Workshop Munich from Ronnie Mitra

Tunnel Style

<RetrieveStudentRecords> <StudentId>1213</StudentId> </RetrieveStudentRecords>

Page 98: API Introduction - API Management Workshop Munich from Ronnie Mitra

Tunnel Style

• lots of tooling • not restricted to HTTP • RPC

Advantages

Page 99: API Introduction - API Management Workshop Munich from Ronnie Mitra

Tunnel Style

• inefficient for HTTP • increased learning curve • lack of tooling in mobile

Trade-offs

Page 100: API Introduction - API Management Workshop Munich from Ronnie Mitra

URI Style

GET PUT

POST DELETE

+ URI

Page 101: API Introduction - API Management Workshop Munich from Ronnie Mitra

URI Style

GET /students/1232

Page 102: API Introduction - API Management Workshop Munich from Ronnie Mitra

URI Style

• familiar to web developers • designed for HTTP • URIs are intuitive

Advantages

Page 103: API Introduction - API Management Workshop Munich from Ronnie Mitra

URI Style

• limited to four methods • URI design is not standard • can be ‘chatty’

Trade-offs

Page 104: API Introduction - API Management Workshop Munich from Ronnie Mitra

Hypermedia Style

Page 105: API Introduction - API Management Workshop Munich from Ronnie Mitra

Hypermedia Style

• links • templated input (forms) • task based

Page 106: API Introduction - API Management Workshop Munich from Ronnie Mitra

{ links: [ link {href: ‘…’ rel: ‘list’}, link {href: ‘…’ rel: ‘add’} ] collection: [ {link: {rel:'complete',href:‘…'},

id:42,

text:‘Record 42'

} ] }

Page 107: API Introduction - API Management Workshop Munich from Ronnie Mitra

Hypermedia Style

• designed for HTTP • long lasting • no URI construction

Advantages

Page 108: API Introduction - API Management Workshop Munich from Ronnie Mitra

Hypermedia Style

• leading-edge • requires ‘smarter’ apps • less familiar to developers

Trade-offs

Page 109: API Introduction - API Management Workshop Munich from Ronnie Mitra

Event Driven Style Example: WebSockets

• event based communication • server initiated events • full-duplex (websocket)

Page 110: API Introduction - API Management Workshop Munich from Ronnie Mitra

Event Driven Style

• less overhead • better performance

Advantages

Page 111: API Introduction - API Management Workshop Munich from Ronnie Mitra

Event Driven Style

• not HTTP-based • resource intensive connections • inefficient for request-reply

Trade-offs

Page 112: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Styles Summary

• Web API != standard

• Four popular styles: Tunnel, URI, Hypermedia, Event

• Choose a style that fits your constraints and goals

Page 113: API Introduction - API Management Workshop Munich from Ronnie Mitra

Usability

Page 114: API Introduction - API Management Workshop Munich from Ronnie Mitra

Interaction Design

Page 115: API Introduction - API Management Workshop Munich from Ronnie Mitra

Usability

Human-Computer-Interaction

User Experience Design

Goal Oriented Design

Page 116: API Introduction - API Management Workshop Munich from Ronnie Mitra

A user-centric view of design.

Page 117: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://www.flickr.com/photos/58754750@N08/5541472392/

Page 118: API Introduction - API Management Workshop Munich from Ronnie Mitra

Well designed products are easier to use.

Page 119: API Introduction - API Management Workshop Munich from Ronnie Mitra

Good design matters for Web APIs too.

Page 120: API Introduction - API Management Workshop Munich from Ronnie Mitra

“Frictionless” integration High rates of adoption Low cost integration

We want:

Page 121: API Introduction - API Management Workshop Munich from Ronnie Mitra

Focus on the developer experience

(dx)

Page 122: API Introduction - API Management Workshop Munich from Ronnie Mitra

Portal

API

Page 123: API Introduction - API Management Workshop Munich from Ronnie Mitra

Why is this difficult?

Page 124: API Introduction - API Management Workshop Munich from Ronnie Mitra

Reason #1

We project our own perspective.

Page 125: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 126: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 127: API Introduction - API Management Workshop Munich from Ronnie Mitra

Your code is not your API.

Your data model is not your API.

Page 128: API Introduction - API Management Workshop Munich from Ronnie Mitra

Reason #2

We project our own biases.

Page 129: API Introduction - API Management Workshop Munich from Ronnie Mitra

Never use SOAP?

Why?

Page 130: API Introduction - API Management Workshop Munich from Ronnie Mitra

Consider keyboards…

Page 131: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://www.flickr.com/photos/yvettemn/139890573/

Page 132: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://www.flickr.com/photos/jonathanpberger/7126054997/

Page 133: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://www.flickr.com/photos/novemberborn/286773981/

Page 134: API Introduction - API Management Workshop Munich from Ronnie Mitra

It doesn’t matter that you don’t like SOAP.

Page 135: API Introduction - API Management Workshop Munich from Ronnie Mitra

What matters is what your developer base thinks!

Page 136: API Introduction - API Management Workshop Munich from Ronnie Mitra

Reason #3

We make bad assumptions.

Page 137: API Introduction - API Management Workshop Munich from Ronnie Mitra

API publishers are also developers.

Page 138: API Introduction - API Management Workshop Munich from Ronnie Mitra

Reason #4

We lack the time, money or incentive for good design

Page 139: API Introduction - API Management Workshop Munich from Ronnie Mitra

“Best practices”, patterns and standards become shortcuts

Page 140: API Introduction - API Management Workshop Munich from Ronnie Mitra

Am I RESTfull enough?

Page 141: API Introduction - API Management Workshop Munich from Ronnie Mitra

So, how can we do better?

Page 142: API Introduction - API Management Workshop Munich from Ronnie Mitra

Developer-centric design requires effort and diligence.

Page 143: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 144: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 145: API Introduction - API Management Workshop Munich from Ronnie Mitra

Is the answer an SDK?

Page 146: API Introduction - API Management Workshop Munich from Ronnie Mitra

An SDK shifts the design effort but does not resolve the usability

challenge

Page 147: API Introduction - API Management Workshop Munich from Ronnie Mitra

Design with the developer in mind.

Page 148: API Introduction - API Management Workshop Munich from Ronnie Mitra

Ask them.

Page 149: API Introduction - API Management Workshop Munich from Ronnie Mitra

• Interviews

• Surveys

• Listen (blogs, presentations, tweets)

Page 150: API Introduction - API Management Workshop Munich from Ronnie Mitra

"If I had asked people what they wanted, they would have said faster horses.“ – Henry Ford?

Page 151: API Introduction - API Management Workshop Munich from Ronnie Mitra

• Observe

• Prototype

• Historical Data

Page 152: API Introduction - API Management Workshop Munich from Ronnie Mitra

Consider all aspects of the DX:

Registration

Security

Troubleshooting

Learning

Interface Style

Page 153: API Introduction - API Management Workshop Munich from Ronnie Mitra

Registration

Lazy Registration

Social Integration

Personalization

Page 154: API Introduction - API Management Workshop Munich from Ronnie Mitra

Development Activity Cycle

1. Learn

2. Code

3. Implement

4. Test

5. Fix

Page 155: API Introduction - API Management Workshop Munich from Ronnie Mitra

Portal

API

Learn

Code

Test

Page 156: API Introduction - API Management Workshop Munich from Ronnie Mitra

API

Learn

Test

Page 157: API Introduction - API Management Workshop Munich from Ronnie Mitra

API explorers and “live documentation” can shorten the

gap between visibility and feedback.

Page 158: API Introduction - API Management Workshop Munich from Ronnie Mitra

1. Identify a Target Audience

2. Learn about the audience

3. Make API design choices that are developer-centric

4. Prototype and get feedback

5. Iterate

How?

Page 159: API Introduction - API Management Workshop Munich from Ronnie Mitra

Focus on the interactions that take place, rather than the interfaces

we expose

Page 160: API Introduction - API Management Workshop Munich from Ronnie Mitra

Great API design can thrive in a developer-centric environment

Page 161: API Introduction - API Management Workshop Munich from Ronnie Mitra

Usability Summary

• Focus on the developer

• Start by thinking in terms of interactions

• Effective for public and private APIs

Page 162: API Introduction - API Management Workshop Munich from Ronnie Mitra

Securing APIs

Page 163: API Introduction - API Management Workshop Munich from Ronnie Mitra

OWASP Top Ten (2010 Edition)

Source: http://www.owasp.org/index.php/Top_10

Page 164: API Introduction - API Management Workshop Munich from Ronnie Mitra

The primary API management challenge:

Balancing Control and Accessibility

Page 165: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 166: API Introduction - API Management Workshop Munich from Ronnie Mitra

Identity Authentication Authorization Availability Integrity Privacy

Page 167: API Introduction - API Management Workshop Munich from Ronnie Mitra

TLS OAuth 2

Open ID Connect

Page 168: API Introduction - API Management Workshop Munich from Ronnie Mitra

OAuth provides a

Delegated Authorization Framework

Page 169: API Introduction - API Management Workshop Munich from Ronnie Mitra

An imperfect analogy….

Page 170: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://www.flickr.com/photos/drewleavy/5587005480

Page 171: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://www.flickr.com/photos/24oranges/5791460046/

Page 172: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://www.flickr.com/photos/grumbler/571106054/

http://www.flickr.com/photos/roboppy/238406811/

Your Money

This Shop Needs Your Money

You need to grant access to your money

Page 173: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://www.flickr.com/photos/drewleavy/5587005480

I won’t tell.

I promise!

Page 174: API Introduction - API Management Workshop Munich from Ronnie Mitra

www.flickr.com/photos/auntiep/255249516

Page 175: API Introduction - API Management Workshop Munich from Ronnie Mitra

Granting access to someone to act

on your behalf.

Page 176: API Introduction - API Management Workshop Munich from Ronnie Mitra

Your resources

This app needs to act on your behalf

You need to grant access to your resources

Page 177: API Introduction - API Management Workshop Munich from Ronnie Mitra

Your google+ data

This app needs to access your Google+ data

You need to grant access to your resources

Page 178: API Introduction - API Management Workshop Munich from Ronnie Mitra

Hi Google.

I’d like to have access to a user’s data.

Page 179: API Introduction - API Management Workshop Munich from Ronnie Mitra

Hang on, let me ask…

Page 180: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 181: API Introduction - API Management Workshop Munich from Ronnie Mitra

He said yes. Here is your

access code.

Page 182: API Introduction - API Management Workshop Munich from Ronnie Mitra

Proprietary authorization implementations

OAuth (2007)

OWrap

OAuth 2

History of OAuth

Page 183: API Introduction - API Management Workshop Munich from Ronnie Mitra

OAuth 2 Grant Types

Grant Types:

- Authorization Code

- Implicit

- Resource Owner Password Credentials

- Client Credentials

Page 184: API Introduction - API Management Workshop Munich from Ronnie Mitra

OAuth 2 Challenges

It is a framework

Page 185: API Introduction - API Management Workshop Munich from Ronnie Mitra

OAuth 2 Challenges

New attack surfaces

Flexible, but complex for API publishers to implement

Utilizes redirection URIs (should be validated with strong rules)

Poor implementations will be exposed (see Facebook)

Not a solution to user authentication

Page 186: API Introduction - API Management Workshop Munich from Ronnie Mitra

OpenID Connect

Identity Access and Authentication (when combined with Open ID)

Built on top of OAuth 2

Not tied to any single vendor or identity provider

Page 187: API Introduction - API Management Workshop Munich from Ronnie Mitra

Open ID, Open ID Connect and OAuth 2

OAuth 2 allows an end-user to grant an application access to protected resources

However:

- The authorization server must still authenticate the end-user

- The client application is unable to determine information about the end-user

Client Application

Resource Owner Authorization Server

User Agent

Send

User

Authentication

Form

?

Authenticate

Page 188: API Introduction - API Management Workshop Munich from Ronnie Mitra

OpenID Authentication can help the server authenticate the end-user

OpenID Connect provides a mechanism for the application to learn about the end-

user

Open ID, Open ID Connect and OAuth 2

Client Application

Resource Owner Authorization Server

User Agent

Send

OpenID

Authentication

Form Authenticate

Retrieve User

Information

OpenID

Resource

Server

Page 189: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 190: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 191: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 192: API Introduction - API Management Workshop Munich from Ronnie Mitra

Security Summary

• Keep focus on usability

• Utilize standards like OAuth and TLS

• Danger in poor implementations

Page 193: API Introduction - API Management Workshop Munich from Ronnie Mitra

Designing an API Architecture

Page 194: API Introduction - API Management Workshop Munich from Ronnie Mitra

http://www.flickr.com/photos/naomi_pincher/3306312873/

Layered Pattern

Page 195: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 196: API Introduction - API Management Workshop Munich from Ronnie Mitra

Representation Layer

Page 197: API Introduction - API Management Workshop Munich from Ronnie Mitra

Component != Connector

Page 198: API Introduction - API Management Workshop Munich from Ronnie Mitra

Component

Database

File System

Message Queue

Transaction Manager

Source Code

Page 199: API Introduction - API Management Workshop Munich from Ronnie Mitra

Components Are Private

Page 200: API Introduction - API Management Workshop Munich from Ronnie Mitra

Connector

Web Server

Browser Agent

Proxy Server

Shared Cache

Page 201: API Introduction - API Management Workshop Munich from Ronnie Mitra

Connectors Are Public

Page 202: API Introduction - API Management Workshop Munich from Ronnie Mitra

Client Server Connectors

Components

The Web

Page 203: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 204: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 205: API Introduction - API Management Workshop Munich from Ronnie Mitra

The Treachery of Images - René Magritte

Page 206: API Introduction - API Management Workshop Munich from Ronnie Mitra

Representation Layer

Representation happens in the Connector

HTTP supports content negotiation

- Accept

- Content-Type

Differing clients (user-agents) === differing representations

- Desktop

- Browser

- Tablet

- Smartphone

Be prepared to support multiple representations

Page 207: API Introduction - API Management Workshop Munich from Ronnie Mitra

• Data and Interface Transformation • Focus on the interface (usability)

Representation

SOAP

Legacy

Page 208: API Introduction - API Management Workshop Munich from Ronnie Mitra

Security Layer

Page 209: API Introduction - API Management Workshop Munich from Ronnie Mitra

Security implementations are difficult:

• Mistakes are costly • Hard to understand specifications • Performance can suffer

Page 210: API Introduction - API Management Workshop Munich from Ronnie Mitra

Don’t implement security in the API Enforce security at the edge

Page 211: API Introduction - API Management Workshop Munich from Ronnie Mitra

Caching Layer

Page 212: API Introduction - API Management Workshop Munich from Ronnie Mitra

Caching Layer

Page 213: API Introduction - API Management Workshop Munich from Ronnie Mitra

Caching Layer

Caching happens EVERYWHERE

HTTP supports Expiration Model and Validation Model Caching

Expiration Model

- Expires

- Cache-Control: max-age

Validation Model

- Last-Modified

- Etag, If-Match

Be prepared to support caching for both client and server

Squid, Varnish, Nginx, MemCacheD, NSURLConnection etc.

Page 214: API Introduction - API Management Workshop Munich from Ronnie Mitra

Orchestration Layer

Page 215: API Introduction - API Management Workshop Munich from Ronnie Mitra

• Chaining multiple calls • Aggregating and enriching data • ‘mashup’ external data with internal data

Orchestration:

Page 216: API Introduction - API Management Workshop Munich from Ronnie Mitra
Page 217: API Introduction - API Management Workshop Munich from Ronnie Mitra

Gateway Pattern

Abstraction of multiple interfaces

In Software Engineering: Façade Pattern

Benefits:

- Deliver a consistent experience

- Centralize API functionality

http://martinfowler.com/eaaCatalog/gateway.html

Page 218: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Gateway

Gateway

API

API

Page 219: API Introduction - API Management Workshop Munich from Ronnie Mitra

Restrict Access Improve Performance Focus on Usability

Page 220: API Introduction - API Management Workshop Munich from Ronnie Mitra

The gateway doesn’t solve all our problems

Page 221: API Introduction - API Management Workshop Munich from Ronnie Mitra

API portals

Portal

Page 222: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Management

Portal

Gateway

API

API

Page 223: API Introduction - API Management Workshop Munich from Ronnie Mitra

We also apply this philosophy behind the firewall.

Page 224: API Introduction - API Management Workshop Munich from Ronnie Mitra

Architecture Summary

• Use a layered architecture

• Deploy a gateway for runtime

• Deploy a portal for developers

Page 225: API Introduction - API Management Workshop Munich from Ronnie Mitra

SOA Governance vs. API Management

Page 226: API Introduction - API Management Workshop Munich from Ronnie Mitra

Web APIs: New and Exciting!

http://www.flickr.com/photos/every1knows/4191971139

Page 227: API Introduction - API Management Workshop Munich from Ronnie Mitra

“Web APIs? I’ve been doing that for years.”

Image courtesy of http://www.flickr.com/photos/en321/3902138429/

Page 228: API Introduction - API Management Workshop Munich from Ronnie Mitra

Web APIs offer us a new perspective

http://www.flickr.com/photos/mugley/4407790613

Page 229: API Introduction - API Management Workshop Munich from Ronnie Mitra

The Modern Philosophy of the Web API:

• self service

• lower barriers and lower costs

• developer-centric

Page 230: API Introduction - API Management Workshop Munich from Ronnie Mitra

All hail the developer kings!

Page 231: API Introduction - API Management Workshop Munich from Ronnie Mitra

SOA Governance

Enforce access control Promote service usage Provide service discovery documents Provide service usage visibility

Page 232: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Management

Enforce access control Promote API usage Provide API documentation Provide API usage visibility

Page 233: API Introduction - API Management Workshop Munich from Ronnie Mitra

SOA Governance

How do we make sure that these services are used properly?

Page 234: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Management

How do we get people to use our API without falling over?

Page 235: API Introduction - API Management Workshop Munich from Ronnie Mitra

Controlled versus Organic

Page 236: API Introduction - API Management Workshop Munich from Ronnie Mitra

Representing organizations is useful Complexity sucks Focus on the user

What can we learn from SOA Governance?

Page 237: API Introduction - API Management Workshop Munich from Ronnie Mitra

Web APIs are acting on a planetary scale

Service

Service

Service

ESB

ISB

API

API

API

Page 238: API Introduction - API Management Workshop Munich from Ronnie Mitra

SOA Governance Summary

• Different but converging

• Developer based perspective

• Based on success

Page 239: API Introduction - API Management Workshop Munich from Ronnie Mitra

API Workshop

Ronnie Mitra

Principal API Architect - Europe

Layer 7 API Academy