Package org.keycloak.adapters.installed
Class KeycloakInstalled
- java.lang.Object
-
- org.keycloak.adapters.installed.KeycloakInstalled
-
public class KeycloakInstalled extends Object
- Author:
- Stian Thorgersen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKeycloakInstalled.Consolestatic classKeycloakInstalled.DesktopProviderstatic classKeycloakInstalled.Pkce
-
Constructor Summary
Constructors Constructor Description KeycloakInstalled()KeycloakInstalled(InputStream config)KeycloakInstalled(KeycloakDeployment deployment)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static KeycloakInstalled.Consoleconsole()protected StringcreateAuthUrl(String redirectUri, String state, KeycloakInstalled.Pkce pkce)protected org.jboss.resteasy.client.jaxrs.ResteasyClientcreateResteasyClient()protected KeycloakInstalled.PkcegeneratePkce()KeycloakDeploymentgetDeployment()IDTokengetIdToken()StringgetIdTokenString()StringgetListenHostname()intgetListenPort()LocalegetLocale()StringgetRefreshToken()protected org.jboss.resteasy.client.jaxrs.ResteasyClientgetResteasyClient()AccessTokengetToken()AccessTokenResponsegetTokenResponse()StringgetTokenString()StringgetTokenString(long minValidity, TimeUnit unit)booleanisDesktopSupported()voidlogin()voidlogin(PrintStream printer, Reader reader)booleanloginCommandLine()booleanloginCommandLine(String redirectUri)Experimental proprietary WWW-Authentication challenge protocol.voidloginDesktop()voidloginManual()voidloginManual(PrintStream printer, Reader reader)voidlogout()voidrefreshToken()voidrefreshToken(String refreshToken)voidsetDesktopProvider(KeycloakInstalled.DesktopProvider desktopProvider)voidsetListenHostname(String listenHostname)Configures the local hostname to listen for callbacks.voidsetListenPort(int listenPort)Configures the local port to listen for callbacks.voidsetLocale(Locale locale)voidsetResteasyClient(org.jboss.resteasy.client.jaxrs.ResteasyClient resteasyClient)
-
-
-
Constructor Detail
-
KeycloakInstalled
public KeycloakInstalled()
-
KeycloakInstalled
public KeycloakInstalled(InputStream config)
-
KeycloakInstalled
public KeycloakInstalled(KeycloakDeployment deployment)
-
-
Method Detail
-
setResteasyClient
public void setResteasyClient(org.jboss.resteasy.client.jaxrs.ResteasyClient resteasyClient)
-
getLocale
public Locale getLocale()
-
setLocale
public void setLocale(Locale locale)
-
getListenPort
public int getListenPort()
-
setListenPort
public void setListenPort(int listenPort)
Configures the local port to listen for callbacks. The value0will choose a random port. Defaults to0.- Parameters:
listenPort- a valid port number
-
getListenHostname
public String getListenHostname()
-
setListenHostname
public void setListenHostname(String listenHostname)
Configures the local hostname to listen for callbacks. The value0will choose a random port- Parameters:
listenHostname- a valid local hostname
-
login
public void login() throws IOException, ServerRequest.HttpFailure, org.keycloak.common.VerificationException, InterruptedException, OAuthErrorException, URISyntaxException- Throws:
IOExceptionServerRequest.HttpFailureorg.keycloak.common.VerificationExceptionInterruptedExceptionOAuthErrorExceptionURISyntaxException
-
login
public void login(PrintStream printer, Reader reader) throws IOException, ServerRequest.HttpFailure, org.keycloak.common.VerificationException, InterruptedException, OAuthErrorException, URISyntaxException
- Throws:
IOExceptionServerRequest.HttpFailureorg.keycloak.common.VerificationExceptionInterruptedExceptionOAuthErrorExceptionURISyntaxException
-
logout
public void logout() throws IOException, InterruptedException, URISyntaxException
-
loginDesktop
public void loginDesktop() throws IOException, org.keycloak.common.VerificationException, OAuthErrorException, URISyntaxException, ServerRequest.HttpFailure, InterruptedException- Throws:
IOExceptionorg.keycloak.common.VerificationExceptionOAuthErrorExceptionURISyntaxExceptionServerRequest.HttpFailureInterruptedException
-
close
public void close()
-
createAuthUrl
protected String createAuthUrl(String redirectUri, String state, KeycloakInstalled.Pkce pkce)
-
generatePkce
protected KeycloakInstalled.Pkce generatePkce()
-
loginManual
public void loginManual() throws IOException, ServerRequest.HttpFailure, org.keycloak.common.VerificationException- Throws:
IOExceptionServerRequest.HttpFailureorg.keycloak.common.VerificationException
-
loginManual
public void loginManual(PrintStream printer, Reader reader) throws IOException, ServerRequest.HttpFailure, org.keycloak.common.VerificationException
- Throws:
IOExceptionServerRequest.HttpFailureorg.keycloak.common.VerificationException
-
console
public static KeycloakInstalled.Console console()
-
loginCommandLine
public boolean loginCommandLine() throws IOException, ServerRequest.HttpFailure, org.keycloak.common.VerificationException- Throws:
IOExceptionServerRequest.HttpFailureorg.keycloak.common.VerificationException
-
loginCommandLine
public boolean loginCommandLine(String redirectUri) throws IOException, ServerRequest.HttpFailure, org.keycloak.common.VerificationException
Experimental proprietary WWW-Authentication challenge protocol. WWW-Authentication: X-Text-Form-Challenge callback="{url}" param="{param-name}" label="{param-display-label}"- Parameters:
redirectUri-- Returns:
- Throws:
IOExceptionServerRequest.HttpFailureorg.keycloak.common.VerificationException
-
getResteasyClient
protected org.jboss.resteasy.client.jaxrs.ResteasyClient getResteasyClient()
-
createResteasyClient
protected org.jboss.resteasy.client.jaxrs.ResteasyClient createResteasyClient()
-
getTokenString
public String getTokenString()
-
getTokenString
public String getTokenString(long minValidity, TimeUnit unit) throws org.keycloak.common.VerificationException, IOException, ServerRequest.HttpFailure
- Throws:
org.keycloak.common.VerificationExceptionIOExceptionServerRequest.HttpFailure
-
refreshToken
public void refreshToken() throws IOException, ServerRequest.HttpFailure, org.keycloak.common.VerificationException- Throws:
IOExceptionServerRequest.HttpFailureorg.keycloak.common.VerificationException
-
refreshToken
public void refreshToken(String refreshToken) throws IOException, ServerRequest.HttpFailure, org.keycloak.common.VerificationException
- Throws:
IOExceptionServerRequest.HttpFailureorg.keycloak.common.VerificationException
-
getToken
public AccessToken getToken()
-
getIdToken
public IDToken getIdToken()
-
getIdTokenString
public String getIdTokenString()
-
getRefreshToken
public String getRefreshToken()
-
getTokenResponse
public AccessTokenResponse getTokenResponse()
-
setDesktopProvider
public void setDesktopProvider(KeycloakInstalled.DesktopProvider desktopProvider)
-
isDesktopSupported
public boolean isDesktopSupported()
-
getDeployment
public KeycloakDeployment getDeployment()
-
-