Auth0 Home Blog Docs

Create JWT token in java with jhipster web service

jwt

#1

I write this code to toke web service in jhipster but this code is static ,i mean every run program must be change the token .

I want to fix this Java code to make dynamic toking.

String url = “http://localhost:8080/api/hussains”;

		URL obj = new URL(url);
		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
		con.setDoOutput(true);
		con.setDoInput(true);
		//add request header
		con.setRequestProperty("Content-Type", "application/json");
		con.setRequestProperty("Accept", "application/json");
		con.setRequestProperty("Authorization", "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImF1dGgiOiJST0xFX0FETUlOLFJPTEVfVVNFUiIsImV4cCI6MTUzNDMwNzU3Mn0.pTDt639DIBdRxSItqxkhqvL1llKXfkYhLZ45_teOHQFtGSaiN8yka4pEPzJsGzeOIlD37OrMVEMx2w2AvycLVg");