Package org.keycloak.adapters.installed
Class KcinitDriver
- java.lang.Object
-
- org.keycloak.adapters.installed.KcinitDriver
-
public class KcinitDriver extends Object
All kcinit commands that take input ask for1. . kcinit - setup and export KC_SESSION_KEY env var if not set. - checks to see if master token valid, refresh is possible, exit if token valid - performs command line login - stores master token for master client 2. app.sh is a wrapper for app cli. - token=`kcinit token app` - checks to see if token for app client has been fetched, refresh if valid, output token to sys.out if exists - if no token, login. Prompts go to stderr. - pass token as cmd line param to app or as environment variable.
3. kcinit password {password} - outputs password key that is used for encryption. - can be used in .bashrc as export KC_SESSSION_KEY=`kcinit password {password}` or just set it in .bat file
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanbrowserLoginprotected Map<String,String>configprotected booleandebugprotected booleanencryptedprotected StringencryptionKeyprotected booleanforceLoginstatic StringKC_LOGIN_CONFIG_PATHstatic StringKC_SESSION_KEYprotected static byte[]salt
-
Constructor Summary
Constructors Constructor Description KcinitDriver()
-
Method Summary
-
-
-
Field Detail
-
KC_SESSION_KEY
public static final String KC_SESSION_KEY
- See Also:
- Constant Field Values
-
KC_LOGIN_CONFIG_PATH
public static final String KC_LOGIN_CONFIG_PATH
- See Also:
- Constant Field Values
-
debug
protected boolean debug
-
salt
protected static byte[] salt
-
forceLogin
protected boolean forceLogin
-
browserLogin
protected boolean browserLogin
-
encryptionKey
protected String encryptionKey
-
encrypted
protected boolean encrypted
-
-
Method Detail
-
getHome
public String getHome()
-
passwordKey
public void passwordKey()
-
generateEncryptionKey
protected String generateEncryptionKey(String password) throws NoSuchAlgorithmException, InvalidKeySpecException
-
createJWE
public JWE createJWE()
-
getEncryptionKey
protected String getEncryptionKey()
-
getConfigDirectory
public File getConfigDirectory()
-
getConfigFile
public File getConfigFile()
-
getTokenDirectory
public File getTokenDirectory()
-
checkEnv
protected void checkEnv()
-
promptLocalPassword
protected void promptLocalPassword()
-
readFileRaw
protected byte[] readFileRaw(File fp) throws IOException
- Throws:
IOException
-
install
public void install()
-
printHelp
public void printHelp()
-
getConfig
public AdapterConfig getConfig()
-
getMasterClientSecret
protected String getMasterClientSecret()
-
getServer
protected String getServer()
-
getRealm
protected String getRealm()
-
forceLogin
protected boolean forceLogin()
-
getHttpClient
public javax.ws.rs.client.Client getHttpClient()
-
-