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.

Un comentariu:

  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