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.

7 comentarii:

  1. Hello! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done an outstanding job.
    Best AWS Training in Chennai | Amazon Web Services Training in Chennai

    AWS Training in Bangalore | Amazon Web Services Training in Bangalore

    Amazon Web Services Training in Pune | Best AWS Training in Pune

    RăspundețiȘtergere
  2. 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
  3. 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
  4. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
    advanced excel training in bangalore

    RăspundețiȘtergere
  5. 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
  6. 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
  7. This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me.. 

    best rpa training in chennai | rpa online training |
    rpa training in chennai |
    rpa training in bangalore
    rpa training in pune
    rpa training in marathahalli
    rpa training in btm

    RăspundețiȘtergere