Class NeoClientConfigResolver
java.lang.Object
org.operaton.bpm.spring.boot.starter.webapp.neo.NeoClientConfigResolver
Resolves the
NeoClientConfig served to the SPA.
The authentication mode defaults to NeoWebappProperty.AUTH_MODE_AUTO,
which means: use OAuth2 when the application has Spring Security OAuth2 client
registrations configured, and basic authentication otherwise. So a user who
integrates an identity provider gets SSO without touching a second switch, and
everyone else gets a username and password form.
Client registrations are read straight from the Environment rather
than from a ClientRegistrationRepository bean, so that this module needs
no dependency on Spring Security — it is optional on the classpath. This mirrors
ClientsNotConfiguredCondition in the security starter.
- Since:
- 2.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final StringThe SPA talks to the application it is served from.protected static final Stringprotected final org.springframework.core.env.Environmentprotected static final Stringprotected static final Stringprotected final OperatonBpmProperties -
Constructor Summary
ConstructorsConstructorDescriptionNeoClientConfigResolver(OperatonBpmProperties properties, org.springframework.core.env.Environment environment) -
Method Summary
Modifier and TypeMethodDescriptionThe id of the first configured OAuth2 client registration, empty when none are configured.protected Stringprotected NeoClientConfig.OAuthresolveOAuth(String contextPath) protected NeoClientConfig.UserresolveUser(Principal principal)
-
Field Details
-
CLIENT_REGISTRATION_PREFIX
- See Also:
-
OAUTH2_LOGIN_PATH
- See Also:
-
OAUTH2_LOGOUT_PATH
- See Also:
-
EMBEDDED_BACKEND_NAME
The SPA talks to the application it is served from.- See Also:
-
EMBEDDED_BACKEND_URL
- See Also:
-
properties
-
environment
protected final org.springframework.core.env.Environment environment
-
-
Constructor Details
-
NeoClientConfigResolver
public NeoClientConfigResolver(OperatonBpmProperties properties, org.springframework.core.env.Environment environment)
-
-
Method Details
-
resolve
- Parameters:
contextPath- the servlet context path, so the login and logout targets stay correct when the application is not deployed at the rootprincipal- the authenticated principal, ornullwhen there is no session
-
resolveAuthMode
-
resolveOAuth
-
resolveUser
-
firstClientRegistrationId
The id of the first configured OAuth2 client registration, empty when none are configured. With several registrations the SPA sends the user to the first one; pick explicitly by settingoperaton.bpm.webapp.neo.auth-modeand letting Spring Security's login page do the choosing.
-