This is project is to demonstrate OpenAPI 3.0 and OAuth2 technology.
cds.yaml is the API spec in OpenAPI 3.0 format. It is converted from the doc in OpenAPI 2.0 format.
The spec exposes a set of banking related APIs and a common customer API. I have added OAuth2 security scheme onto it.
The client
folder contains 2 projects:
java
is the java version clientjs
is the nodejs version client
The server
folder contains 2 projects:
auth
is the OAuth2 serverresource
is the Resource server (API end points provider)
Both projects are implemented with Spring boot 2 framework.
I recorded a YouTube video to demo them working together.
I have deployed them to Heroku. You can play it here https://openbank-resource.herokuapp.com The username / password are user / pass respectively when you authorize the swagger ui to access the APIs
- Open a terminal and navigate to
server/auth
folder and runmvn spring-boot:run
to start OAuth2 server at http://localhost:9090 - Open another terminal navigate to
server/resource
folder and runmvn spring-boot:run
to start Resource server at http://localhost:8080 - Open a browser and navigate to http://localost:8080 and you should see the swagger UI and be able to play with APIs
- Click "Authorize" button and a popup will show
- Click "Authorize" on the popup, a new tab will be opened for user to login
- Type "user" and "pass" as username / password and Click Sign in, you'll be redirected to the API screen
- You are authorised to get protected resource from the API now.