|
958 | 958 | | 14| [What are JWT?](#what-are-jwt)|
|
959 | 959 | | 15| [What are different authentication methods?](#what-are-different-authentication-methods)|
|
960 | 960 | | 16| [What are disadvantages of using session based authentication?](#what-are-disadvantages-of-using-session-based-authentication)|
|
| 961 | +| 17| [What are disadvantages of using jwt based authentication?](#what-are-disadvantages-of-using-jwt-based-authentication)| |
961 | 962 |
|
962 | 963 | 1. ### What is MongoDB?
|
963 | 964 |
|
|
1200 | 1201 | **[⬆ Back to Top](#table-of-contents---mongodb-and-mongoose)**
|
1201 | 1202 |
|
1202 | 1203 |
|
1203 | | -15. ### What are disadvantages of using session based authentication? |
| 1204 | +16. ### What are disadvantages of using session based authentication? |
1204 | 1205 |
|
1205 | 1206 |
|
1206 | 1207 |
|
1207 | | - Since data in session state is stored in server memory, it is not advisable to use session state when working with large sum of data. Session state variable stays in memory until you destroy it, so too many variables in the memory effect performance. |
| 1208 | + **Compromised Secret Key** : The best and the worst thing about JWT is that it relies on just one Key. Consider that the Key is leaked by a careless or a rogue developer/administrator, the whole system is compromised!<br/> |
| 1209 | + **Cannot manage client from the server**<br/>**Cannot push Messages to clients** <br/>**Crypto-algo can be deprecated**<br/>**Data Overhead** : The size of the JWT token will be more than that of a normal Session token<br/>Complicated to understand: JWT uses cryptographic Signature algorithms to verify the data and get the user-id from the token. Understanding the Signing Algo in itself requires basics of cryptography. <br/> |
| 1210 | + |
| 1211 | + |
| 1212 | + |
1208 | 1213 |
|
| 1214 | +**[⬆ Back to Top](#table-of-contents---mongodb-and-mongoose)** |
| 1215 | + |
| 1216 | + |
| 1217 | +16. ### What are disadvantages of using jwt based authentication? |
| 1218 | + |
| 1219 | + |
| 1220 | + |
| 1221 | + **Session based authentication**:<br/> Because the sessions are stored in the server’s memory, scaling becomes an issue when there is a huge number of users using the system at once.<br/>Cookies normally work on a single domain or subdomains and they are normally disabled by browser if they work cross-domain (3rd party cookies). It poses issues when APIs are served from a different domain to mobile and web devices. |
1209 | 1222 |
|
1210 | 1223 |
|
1211 | 1224 |
|
1212 | 1225 |
|
1213 | 1226 | **[⬆ Back to Top](#table-of-contents---mongodb-and-mongoose)**
|
1214 | 1227 |
|
1215 | 1228 |
|
| 1229 | + |
1216 | 1230 |
|
0 commit comments