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.

9 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

  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

  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.

  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

  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

  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

  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

  8. Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.

    devops online training

    aws online training

    data science with python online training

    data science online training

    rpa online training

  9. Outstanding blog post, I have marked your site so ideally I’ll see much more on this subject in the foreseeable future.
    Microsoft Azure online training
    Selenium online training
    Java online training
    Python online training
    uipath online training