У меня есть существующая настройка аутентификации Spring Security для входов в систему на основе БД. Я хочу интегрировать вход в Google через Keycloak, но это будет только путем нажатия ссылки на главном экране.
Мой Db логин работает. Затем, когда я изменил настройки на основе https://www.keycloak.org/docs/2.5/securing_apps/topics/oidc/java/spring-security-adapter.html, мой вход в Keycloak работает. Я хочу, чтобы они оба работали вместе, и я не уверен, как настроить мой фильтр и провайдера.
Моя текущая конфигурация:
<security:http auto-config="false" entry-point-ref="loginUrlAuthenticationEntryPoint">
<security:custom-filter ref="customAuthFilter" position="FORM_LOGIN_FILTER"/>
</security:http>
<bean id="customAuthFilter" class="com.xyz.auth.filter.CustomAuthFilter">
<property name="authenticationManager" ref="customAuthenticationManager"/>
<property name="filterProcessesUrl" value="/perform-login"/>
<property name="authenticationSuccessHandler">
<bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler">
<property name="useReferer" value="true"/>
</bean>
</property>
<property name="authenticationFailureHandler">
<bean class="com.xyz.auth.handler.AuthFailureHandler"/>
</property>
<property name="sessionAuthenticationStrategy">
<bean class="org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy">
<property name="alwaysCreateSession" value="true"/>
</bean>
</property>
</bean>
<security:authentication-manager id="customAuthenticationManager">
<security:authentication-provider ref="DBAuthProviderImpl"/>
</security:authentication-manager>
Ожидаемый результат: страница входа в систему, запрашивающая имя пользователя и пароль, и нажатие кнопки для перехода на страницу с плащом для ключей.