Skip to content

Instantly share code, notes, and snippets.

@thescouser89
Created February 13, 2019 19:04
Show Gist options
  • Save thescouser89/ec62e4094f596cba32962a2ef72d5936 to your computer and use it in GitHub Desktop.
Save thescouser89/ec62e4094f596cba32962a2ef72d5936 to your computer and use it in GitHub Desktop.
File initialFile = new File("/home/dcheung/keycloak.json");
InputStream targetStream = new FileInputStream(initialFile);
KeycloakInstalled keycloakInstalled = new KeycloakInstalled(targetStream);
System.out.println("-- Login in --");
keycloakInstalled.loginCommandLine();
System.out.println("-- Getting token --");
System.out.println(keycloakInstalled.getTokenString());
// Output
-- Login in --
Failure: Invalid WWW-Authenticate header.
-- Getting token --
null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment