cd2bit / signsfive-api

0 stars 0 forks source link

Securing the API #5

Open kratsg opened 7 years ago

kratsg commented 7 years ago

Here are a collection of thoughts I have for securing the API: use JWTs.

My guess is we can use Auth0 with a Third-Party Client (https://auth0.com/docs/clients/client-types#first-vs-third-party-clients) for the last two cases. For the guest case, we will let the website be a first-party-client. This allows us to use the same Auth0 application (our API) for 2 different types of users -- which helps to have something like Dynamic Client Registration.

Now with all that being said, since we use restify -- we can easily roll our own JWT validation solution (it's like maybe 20 lines) rather than using a node package like https://github.com/amrav/restify-jwt (which doesn't seem updated a lot).

A good tutorial that covered all of this is here: https://scotch.io/tutorials/building-and-securing-a-modern-backend-api

kratsg commented 6 years ago

Here's a list of pages from Auth0 that are going to seem related: