keycloak-scim/topics/oidc/java/jaas.adoc

32 lines
2 KiB
Text
Raw Normal View History

2016-04-18 19:10:32 +00:00
[[_jaas_adapter]]
2016-06-01 11:02:44 +00:00
=== JAAS plugin
2016-04-18 19:10:32 +00:00
2016-06-03 10:35:36 +00:00
It's generally not needed to use JAAS for most of the applications, especially if they are HTTP based, and you should most likely choose one of our other adapters.
However, some applications and systems may still rely on pure legacy JAAS solution.
{{book.project.title}} provides two login modules to help in these situations.
2016-04-18 19:10:32 +00:00
2016-06-03 10:35:36 +00:00
The provided login modules are:
2016-04-18 19:10:32 +00:00
org.keycloak.adapters.jaas.DirectAccessGrantsLoginModule::
2016-06-03 10:35:36 +00:00
This login module allows to authenticate with username/password from {{book.project.title}}.
It's using <<fake/../../oidc-generic.adoc#_resource_owner_password_credentials_flow,Resource Owner Password Credentials>> flow to validate if the provided
username/password is valid. It's useful for non-web based systems, which need to rely on JAAS and want to use Keycloak, but can't use the standard browser
based flows due to their non-web nature. Example of such application could be messaging or SSH.
2016-04-18 19:10:32 +00:00
org.keycloak.adapters.jaas.BearerTokenLoginModule::
2016-06-03 10:35:36 +00:00
This login module allows to authenticate with {{book.project.title}} access token passed to it through CallbackHandler as password.
It may be useful for example in case, when you have {{book.project.title}} access token from standard based authentication flow and your web application then
needs to talk to external non-web based system, which rely on JAAS. For example a messaging system.
Both modules use the following configuration properties:
2016-04-18 19:10:32 +00:00
2016-06-03 10:35:36 +00:00
keycloak-config-file::
The location of the `keycloak.json` configuration file. The configuration file can either be located on the filesystem or on the classpath. If it's located
on the classpath you need to prefix the location with `classpath:` (for example `classpath:/path/keycloak.json`).
This is _REQUIRED._
2016-04-18 19:10:32 +00:00
2016-06-03 10:35:36 +00:00
`role-principal-class`::
Configure alternative class for Role principals attached to JAAS Subject.
2016-06-09 12:28:28 +00:00
Default value is `org.keycloak.adapters.jaas.RolePrincipal`. Note: The class is required to have a constructor with a single `String` argument.
2016-06-09 12:29:01 +00:00