In this 2nd part I made a more complex example to be more practical in real life, and created a web app that is gets its users from db and stores the clients, and tokens in db instead of memory so it's more scalable.
1- users & roles in database
2- oauth related info stored in db (tokens, clients, approvals, etc..)
3- two APIs : a- cats apis, b- dogs api; each one of these can be accessed only if the access token has a proper scope (cats scope and dogs scope)
the app uses h2 in memory database so that it be self contained and no external setup is required
and here is the source code :
1- get access token to with scope cats:
a- get the auth code :
go to : localhost:8080/oauth/authorize?response_type=code&client_id=cats-client&redirect_uri=http://localhostcats/redirect
2- login with a user
4- get the authorization code
5- exchange the code for a token
6- access cats api:
7- try the dogs api
try to get a valid token to access the dogs api by yourself should be similar to the cats process..
get familiar with the source code, it's only a step up and we only used the classes from the oauth2lw-core we added the jdbc datasource and the token store and passed these to our configures.
Sunday, January 8, 2017
istio archeticture (source istio.io) I would like to share with you a sample repo to start and help you continue your jou...
In this post I'll explain the required work to create a rest API utilizing both spring and hibernate version 4, and the configuration wi...
So RecyclerView was introduced to replace List view and it's optimized to reuse existing views and so it's faster and more efficient...
In the previous part we finished the dashboard read functionality, now we want to add the skeleton for other pages: - Login In this p...