How to decode JWT (Header and Body) in java using Apache Commons Codec?

Here you go: import org.apache.commons.codec.binary.Base64; @Test public void testDecodeJWT(){ String jwtToken = “eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0Iiwicm9sZXMiOiJST0xFX0FETUlOIiwiaXNzIjoibXlzZWxmIiwiZXhwIjoxNDcxMDg2MzgxfQ.1EI2haSz9aMsHjFUXNVz2Z4mtC0nMdZo6bo3-x-aRpw”; System.out.println(“———— Decode JWT ————“); String[] split_string = jwtToken.split(“\\.”); String base64EncodedHeader = split_string[0]; String base64EncodedBody = split_string[1]; String base64EncodedSignature = split_string[2]; System.out.println(“~~~~~~~~~ JWT Header ~~~~~~~”); Base64 base64Url = new Base64(true); String header = new String(base64Url.decode(base64EncodedHeader)); System.out.println(“JWT Header : ” + header); System.out.println(“~~~~~~~~~ JWT … Read more

What is the advantage of storing schema in avro?

Evolving schemas Suppose intially you designed an schema like this for your Employee class { {“name”: “emp_name”, “type”:”string”}, {“name”:”dob”, “type”:”string”}, {“name”:”age”, “type”:”int”} } Later you realized that age is redundant and removed it from the schema. { {“name”: “emp_name”, “type”:”string”}, {“name”:”dob”, “type”:”string”} } What about the records that were serialized and stored before this schema … Read more

How much does using htaccess files slow down website performance (especially with solid state disks)?

From an answer on Quora by Jonathan Klein, 12ms for a 1500 line .htaccess file: Having a large .htaccess does have a cost. Ours is currently ~1500 lines and we benchmarked the time spent parsing it at around 10-12ms on a production webserver. Hardware makes a difference obviously, but you can fairly safely assume that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)