Class KeycloakAuthProvider
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.frostserver.auth.keycloak.KeycloakAuthProvider
-
- All Implemented Interfaces:
ConfigDefaults,AuthProvider,LiquibaseUser
public class KeycloakAuthProvider extends Object implements AuthProvider, LiquibaseUser, ConfigDefaults
- Author:
- scf
-
-
Field Summary
Fields Modifier and Type Field Description static StringTAG_KEYCLOAK_CONFIGstatic StringTAG_KEYCLOAK_CONFIG_FILEstatic StringTAG_KEYCLOAK_CONFIG_SECRETIf the client has "access-type" set to "confidential" then a secret is required to download the configuration.static StringTAG_KEYCLOAK_CONFIG_URLThe URL on the Keycloak server that can be used to download the Keycloak config file.
-
Constructor Summary
Constructors Constructor Description KeycloakAuthProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFilter(Object context, CoreSettings coreSettings)StringcheckForUpgrades()booleandoUpgrades(Writer out)voidinit(CoreSettings coreSettings)booleanisValidUser(String clientId, String username, String password)booleanuserHasRole(String clientId, String userName, String roleName)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.fraunhofer.iosb.ilt.frostserver.settings.ConfigDefaults
configDefaults, configDefaultsInt, configTags, defaultValue, defaultValueBoolean, defaultValueInt
-
-
-
-
Field Detail
-
TAG_KEYCLOAK_CONFIG
public static final String TAG_KEYCLOAK_CONFIG
- See Also:
- Constant Field Values
-
TAG_KEYCLOAK_CONFIG_FILE
public static final String TAG_KEYCLOAK_CONFIG_FILE
- See Also:
- Constant Field Values
-
TAG_KEYCLOAK_CONFIG_URL
public static final String TAG_KEYCLOAK_CONFIG_URL
The URL on the Keycloak server that can be used to download the Keycloak config file. Usually this url is in the for of: https://keycloak.example.com/auth/realms/[realm]/clients-registrations/install/[client id]- See Also:
- Constant Field Values
-
TAG_KEYCLOAK_CONFIG_SECRET
public static final String TAG_KEYCLOAK_CONFIG_SECRET
If the client has "access-type" set to "confidential" then a secret is required to download the configuration. This secret can be found in the configuration itself, in Keycloak.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(CoreSettings coreSettings)
- Specified by:
initin interfaceLiquibaseUser
-
addFilter
public void addFilter(Object context, CoreSettings coreSettings)
- Specified by:
addFilterin interfaceAuthProvider
-
isValidUser
public boolean isValidUser(String clientId, String username, String password)
- Specified by:
isValidUserin interfaceAuthProvider
-
userHasRole
public boolean userHasRole(String clientId, String userName, String roleName)
- Specified by:
userHasRolein interfaceAuthProvider
-
checkForUpgrades
public String checkForUpgrades()
- Specified by:
checkForUpgradesin interfaceLiquibaseUser
-
doUpgrades
public boolean doUpgrades(Writer out) throws UpgradeFailedException, IOException
- Specified by:
doUpgradesin interfaceLiquibaseUser- Throws:
UpgradeFailedExceptionIOException
-
-