Skip to content

Instantly share code, notes, and snippets.

@peterjgrainger
Created May 12, 2023 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterjgrainger/9f8ce6223f2457846d2280b22e9a0a6c to your computer and use it in GitHub Desktop.
Save peterjgrainger/9f8ce6223f2457846d2280b22e9a0a6c to your computer and use it in GitHub Desktop.
public void readSecret() {
try {
URL yahoo = new URL("http://localhost:2773/secretsmanager/get?secretId=/authorizer/jwt");
URLConnection yc = yahoo.openConnection();
yc.setRequestProperty("X-Aws-Parameters-Secrets-Token", System.getenv("AWS_SESSION_TOKEN"));
BufferedReader in = new BufferedReader(
new InputStreamReader(
yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
} catch (Exception e) {
System.out.println(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment