Twitter

miercuri, 29 iunie 2016

Using PrimeNG to authenticate via JWT to a container-less RestExpress microservice

We have two container-less microservices defined in RestExpress. The endpoints are:

AuthenticationService - this service respond to:
http://localhost:8587/clients.json - create a new client
http://localhost:8587/jwts.json?apiKey={apikey}&secret={password} - create a new JWT
http://localhost:8587/jwts/{jwt} - verify if a JWT is valid

SecretService - this service needs authentication and it respond to:
http://localhost:8086/secret/{secretid} - send a secret ID to the secret service

In order to run the app:

1. Download, install MongoDB - this is needed for storing the users
2. Start MongoDB and the AuthenticationService as in the README.txt file
3. Start SecretService as in the README.txt file
4. Run npm install and npm start from  the /PrimeNGandRestExpress/primengapp folder

Some screenshots:

Trying to access the SecretService without authentication:

Creating a new JWT:

Sending data to the SecretService after authentication:

The complete example is available here.

6 comentarii:

  1. I would really like to read some personal experiences like the way, you've explained through the above article. I'm glad for your achievements and would probably like to see much more in the near future. Thanks for share.
    angularjs Training in chennai
    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    RăspundețiȘtergere
  2. This is beyond doubt a blog significant to follow. You’ve dig up a great deal to say about this topic, and so much awareness. I believe that you recognize how to construct people pay attention to what you have to pronounce, particularly with a concern that’s sPython training in marathahalli | Python training institute in puneo vital. I am pleased to suggest this blog.

    RăspundețiȘtergere
  3. A universal message I suppose, not giving up is the formula for success I think. Some things take longer than others to accomplish, so people must understand that they should have their eyes on the goal, and that should keep them motivated to see it out til the end.
    Java training in Marathahalli | Java training in Btm layout

    Java training in Jaya nagar | Java training in Electronic city

    RăspundețiȘtergere
  4. I am sure this post has helped me save many hours of browsing other related posts just to find what I was looking for. Many thanks!
    Data Science course in Indira nagar
    Data Science course in marathahalli
    Data Science Interview questions and answers


    RăspundețiȘtergere