Posts

Showing posts from 2019

JWT SpringBoot

Image
------ git  ------------------------------------------ interceptor https://github.com/jpssasadara/SrpingBoot_JWT ----------------------------------------- videos What Happens If Your JWT Is Stolen? All of us know what happens if our user credentials (email and password) are discovered by an attacker: they can log into our account and wreak havoc. But a lot of modern applications are using JSON Web Tokens (JWTs) to manage user sessions—what happens if a JWT is compromised? Because more and more applications are using token-based authentication, this question is increasingly relevant to developers and critical to understand if you’re building any sort of application that uses token-based authentication. To help explain the concepts fully, I’ll walk you through what tokens are, how they’re used, and what happens when they’re stolen. Finally: I’ll cover what you should actually do if your token has been stolen, and how to prevent this in the future. This post was...

Why should you use standard HTTP methods while designing REST APIs?

https://www.youtube.com/watch?v=rhTkRK53XdQ One of the characteristics of a good REST API is that it uses the standard HTTP methods in a way they are supposed to be used. We hear this all the time and this is the most fundamental guideline of REST. As generally understood, we use the following HTTP methods while designing REST APIs GET —  For returning resources POST —  For creating a new resource PUT —  For updating a resource PATCH  — For updating a resource DELETE —  For deleting a resource But beyond the basics, why is it like that? Isn’t use of two methods, PUT and PATCH for an update operation confusing? What do the specs say? Let’s first get the obvious out of the way. Let’s see what the specs say GET The GET method requests transfer of a current selected representation for the  target resource . GET is the primary mechanism of information retrieval What this really means is that you should use GET for an API method that ret...

Servers

https://www.youtube.com/watch?v=Nu-18s6EeM8 https://www.youtube.com/watch?v=ATObcDPLa40 https://www.javatpoint.com/server-web-vs-application What is Tomcat? Apache Tomcat is an open-source web server and servlet container for rendering Java Server Pages (JSPs) and executing servlets. Web applications can be deployed to a Tomcat server using WAR files (Java web archive files). Tomcat does not support the full EE stack and will not deploy EAR files. If you don’t have a place to run your Tomcat yet, you can check out JavaPipe’s  Java web hosting  offers and see if that’s what you’re looking for. For now let’s proceed on how to setup your own Tomcat container. https://stackoverflow.com/questions/29397202/does-glassfish-server-consist-of-a-webserver-also Does Glassfish server consist of a webserver also? 1 According to the defintions I have read a  web server  is something which can serve http requests (e.g Apache). A  web co...