Guarding GraphQL
Strategies for Robust API Authorization
Viktor Gamov, October 24th, Santa Clara, California
X: @gamussa @thekonginc
Slide 2
@gamussa | #APIWorld | @thekonginc
Slide 3
@gamussa | #APIWorld | @thekonginc
Slide 4
@gamussa | #APIWorld | @thekonginc
Slide 5
@gamussa | #APIWorld | @thekonginc
Slide 6
THE CLOUD API COMPANY
@gamussa | #APIWorld | @thekonginc
Kong Confidential
Slide 7
Viktor GAMOV Principal Developer Advocate | Kong
THE CLOUD API COMPANY
Twitter X: @gamussa
Kong Confidential
Slide 8
Danny FREESE Partner Solutions Engineer | Kong
THE CLOUD API COMPANY
X: @thekonginc
Kong Confidential
Slide 9
Agenda • Start from the beginning - REST or GraphQL • Why is Authorization with GraphQL Hard to Tackle? • REST example • GraphQL example • Tackling AuthZ with API Gateway
@gamussa | #APIWorld | @thekonginc
Schema De ne your API
type Route { origin: String! destination: String! } type Flight { number: String! route: Route! scheduled_departure: String! scheduled_arrival: String! } type Booking { ticket_number: String! flight: Flight! seat: String! }
fi
@gamussa | #APIWorld | @thekonginc
Slide 12
Queries Get what you need
type Query { routes(origin: [String!]): [Route!]! flights(date: String!): [Flight!]! bookings(customer_id: ID!): [Booking!]! }
@gamussa | #APIWorld | @thekonginc
Slide 13
Queries Get what you need
type Query { routes(origin: [String!]): [Route!]! flights(date: String!): [Flight!]! bookings(customer_id: ID!): [Booking!]! }
query { flights(date: “2024-03-20”) { number route { origin destination } scheduled_departure } }
@gamussa | #APIWorld | @thekonginc