Getting started with OAuth 2.0

We'll start the new year with a gentle introduction to OAuth 2.0, by working together to understand what's required and prepare for & make a call to an API in the "Core Services for SAP BTP" API package. We'll take things nice and slow, learning-by-doing and digging into as much detail as we need. Join us, all welcome!

oauth, oauth2.0, jq, bash, curl, sap, btp, cf, cloudfoundry, btp cli, ijq, jwt, jwt-cli

Understand OAuth 2.0 grant types https://github.com/SAP-archive/cloud-apis-virtual-event/tree/main/exercises/02#3-understand-oauth-20-grant-types
Core Services for SAP BTP API package https://api.sap.com/package/SAPCloudPlatformCoreServices/rest

00:00 Welcome and introduction
05:10 Understanding OAuth 2.0 grant types
08:40 Navigating to the endpoint on the SAP API Business Hub
11:10 Thinking about the scope required for the given endpoint
11:50 Exploring the documentation that we need to read
15:00 Looking at the service plans for the cis service, and what scopes they include
17:05 Logging in to the Cloud Foundry environment with the cf CLI
18:24 Learning how to find the API endpoint for cf programatically
20:44 Exploring the Cloud Foundry marketplace, looking for the cis service & plans
22:00 Creating a cis service instance with the central plan
22:54 Creating a service key (binding) from that instance and taking a first look at the data
25:30 Looking at the HTTP request and the data that we need to request a token
29:24 Writing a small script to prepare for and make the HTTP request for the token
31:26 Noting that we need to urlencode the form data
38:50 Making the call and successfully obtaining a token
40:05 Examining the token and related details that are returned (type, expiry info, refresh token, scopes, etc)
43:05 Getting ready to make the call to the endpoint
48:05 Making the call, and realising it was waiting for input on STDIN
56:25 Examining the successful output
52:44 Thinking about the token's lifetime
53:45 Examining the content of the otherwise opaque access token with jwt-cli
Be the first to comment