问题标签 [spring-security-kerberos]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
2463 浏览

spring-boot - Spring Boot + Ldap / AD + Kerberos SSO:KrbCryptoException - 校验和失败

我正在尝试使用 Spring Boot、Ldap 和 kerberos 实现 SSO。对于不同的加密类型,我遇到多个校验和失败的错误。

环境细节:-

机器:Windows 10

JDK版本:Oracle 1.8.0_144(64位)

我似乎遇到了一个死胡同,我无法找到任何解决方案。

这是我在运行时遇到的错误

我从 Windows 服务器生成的 Keytab 文件,其中 AD 可通过此命令使用 -

为同一用户设置SPN

通过命令检查keytab文件

这是结果

还更新了安全选项的客户端和服务器设置并标记检查以允许加密类型

在此处输入图像描述

这是安全配置java文件

以下是Windows 10 机器中位于C:\Windows的krb5.ini文件的内容:-

我还更新了C:\Program Files\Java\jre1.8.0_191\lib\security 和 C:\Program Files\Java\jdk1.8.0_144\jre\lib\security 文件夹下的JCE jar文件。

应该怎么做才能克服这个异常?是否有任何 Java 代码需要更新或 kerberos 的任何配置需要更改。有没有人有任何想法?

更新 1:

校验和问题仍然可用。但是,当我使用 kinit 命令从 JAVA JDK 检查 keytab 文件时,我看到了一个新问题,

我从 JDK 1.8 bin 目录中的服务器执行了以下命令

并得到 ICMP 端口不可达错误

0 投票
0 回答
1361 浏览

java - 无法使用 jdbc 模板将 Spring Boot 与 Secured Kerberos 连接

我正在尝试将 kerberos 集群与 springboot 连接并面临一些问题 - 如果我的代码 -

我得到了例外 -

* {"timestamp":"2019-12-04T17:56:23.118+05:30","version":1,"message":"CalendarRecommendationDAOImpl 方法发生异常 - getCalendarRecommendations","logger_name":"com.virginvoyages .nbx.dao.impl.CalendarDaoSupport","thread_name":"http-nio-8438-exec-1","level":"ERROR","level_value":40000,"stack_trace":"org.springframework.jdbc .CannotGetJdbcConnectionException: 获取 JDBC 连接失败;嵌套异常为 java.sql.SQLException: ERROR 103 (08004): 无法建立连接。\r\n\tat org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java :81)\r\n\tat org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:371)\r\n\tat org.springframework.jdbc.core。JdbcTemplate.query(JdbcTemplate.java:452)\r\n\tat org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:462)\r\n\tat org.springframework.jdbc.core.JdbcTemplate. queryForObject(JdbcTemplate.java:473)\r\n\tat com.virginvoyages.nbx.dao.impl.CalendarDaoSupport.getCalendarRecommendations(CalendarDaoSupport.java:199)\r\n\tat com.virginvoyages.nbx.dao.impl。 CalendarDaoSupport$$FastClassBySpringCGLIB$$e665c50f.invoke()\r\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)\r\n\tat org.springframework.aop.framework.CglibAopProxy $CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\r\n\tat org.springframework.aop.interceptor.ExposeInvocationInterceptor .invoke(ExposeInvocationInterceptor.java:93)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\r\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:第688章.java:43)\r\n\tat com.virginvoyages.nbx.assembly.impl.CalendarRecommendationAssemblyImpl$$FastClassBySpringCGLIB$$bf2eae41.invoke()\r\n\tat org.springframework.cglib.proxy.MethodProxy.invoke( MethodProxy.java:218)\r\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)\r\n\tat org.springframework.aop。framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\r\n\tat org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)\r\n\tat org.springframework.aop.framework。 ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\r\n\tat org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56)\r\n\tat org.springframework.aop.framework。 ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\r\n\tat org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:55)\r\n\tat org.springframework.aop.framework。 ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\r\n\tat org.springframework.aop.interceptor。ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\r\n\tat org.springframework.aop.framework.CglibAopProxy$ DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)\r\n\tat com.virginvoyages.nbx.assembly.impl.CalendarRecommendationAssemblyImpl$$EnhancerBySpringCGLIB$$6cb4e4b4.getCalendarRecommendation()\r\n\tat com.virginvoyages.nbx.calendar .CalendarRecommendationController.calendarRecommendationPost(CalendarRecommendationController.java:90)\r\n\tat com.virginvoyages.nbx.calendar.CalendarRecommendationController$$FastClassBySpringCGLIB$$d5e5fde5.invoke()\r\n\tat org.springframework.cglib.proxy。 MethodProxy.invoke(MethodProxy.java:218)\r\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation。invokeJoinpoint(CglibAopProxy.java:749)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\r\n\tat org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor。调用(MethodBeforeAdviceInterceptor.java:56)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\r\n\tat org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor。调用(AfterReturningAdviceInterceptor.java:55)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\r\n\tat org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke( ExposeInvocationInterceptor.java:93)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\r\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)\r\n\tat com.virginvoyages.nbx.calendar.CalendarRecommendationController$$EnhancerBySpringCGLIB$$25 ffe737.calendarRecommendationPost()\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun。 reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.springframework.web.method.support. InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)\r\n\tat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)\r\n\tat org.springframework.web.servlet。 mvc.method.annotation。ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)\r\n\tat org.springframework。 web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)\r\n\tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\r \n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)\r\n \tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)\r\n\tat org.springframework.web.servlet.FrameworkServlet。doPost(FrameworkServlet.java:908)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:665)\r\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet. java:882)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:750)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) \r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) \r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r \n\tat com.virginvoyages.logging.LogFilter.doFilter(LogFilter.java:54)\r\n\tat org.apache.catalina.core。ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat com.virginvoyages.api.OriginFilter.doFilter( OriginFilter.java:27)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. java:166)\r\n\tat org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90)\r\n\tat org.springframework.web.filter.OncePerRequestFilter。 doFilter(OncePerRequestFilter.java:107)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(应用过滤链。java:166)\r\n\tat com.virginvoyages.logging.LogFilter.doFilter(LogFilter.java:54)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) \r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) \r\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)\r\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter( FilterSecurityInterceptor.java:91)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.access.ExceptionTranslationFilter。doFilter(ExceptionTranslationFilter.java:119)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.session。 SessionManagementFilter.doFilter(SessionManagementFilter.java:137)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web。 authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security。 web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)\r\n\tat org.springframework.security. web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:176)\r\n\tat org. springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)\r\n \tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.header。HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)\r\n\tat org.springframework.security.web。 FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)\r\n\tat org. springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain。doFilter(FilterChainProxy.java:334)\r\n\tat org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)\r\n\tat org.springframework.security.web.FilterChainProxy.doFilter( FilterChainProxy.java:178)\r\n\tat org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)\r\n\tat org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy. java:270)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 166)\r\n\tat org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) \r\n\tat org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r \n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n \tat org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.apache.catalina.core。ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.springframework.boot.actuate.metrics。 web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117)\r\n\tat org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\tat org. apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) \r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)\r \n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\r\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)\r\n \tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)\r\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\r\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)\r\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)\r\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)\r\n\tat org.apache。 coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)\r\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)\r\n\tat org.apache.tomcat.util。 net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)\r\n\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\r\n\tat java.util. concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\r\n\tat org.apache.tomcat.util. threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\n原因:java.sql。SQLException:错误 103 (08004):无法建立连接。\r\n\tat org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:494)\r\n\tat org.apache。 phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)\r\n\tat org.apache.phoenix.jdbc.PhoenixEmbeddedDriver$ConnectionInfo.no​​rmalize(PhoenixEmbeddedDriver.java:396)\r\n\tat org.apache。 phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:238)\r\n\tat org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:150)\r\n\tat org.apache.phoenix。 jdbc.PhoenixDriver.connect(PhoenixDriver.java:221)\r\n\tat java.sql.DriverManager.getConnection(DriverManager.java:664)\r\n\tat java.sql.DriverManager.getConnection(DriverManager.java: 208)\r\n\tat org.springframework.jdbc.datasource.DriverManagerDataSource。getConnectionFromDriverManager(DriverManagerDataSource.java:154)\r\n\tat org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:145)\r\n\tat org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver( AbstractDriverBasedDataSource.java:205)\r\n\tat org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:169)\r\n\tat org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils. java:157)\r\n\tat org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)\r\n\tat org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java: 78)\r\n\t...省略了 145 个常用帧\r\n原因:java.io.IOException:从 keytab nbx.service@VIRGINVOYAGES.QA.DEV 登录 2181/hbase-secure 失败:javax.security.auth.login.LoginException:无法从用户获取密码\n\r\n\tat org.apache.hadoop。 security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:979)\r\n\tat org.apache.hadoop.security.SecurityUtil.login(SecurityUtil.java:246)\r\n\tat org.apache.hadoop.hbase。 security.User$SecureHadoopUser.login(User.java:420)\r\n\tat org.apache.hadoop.hbase.security.User.login(User.java:258)\r\n\tat org.apache。 phoenix.jdbc.PhoenixEmbeddedDriver$ConnectionInfo.no​​rmalize(PhoenixEmbeddedDriver.java:387)\r\n\t...省略了157个常用帧\r\n原因:javax.security.auth.login.LoginException: Unable to get password from用户\n\r\n\tat com.sun.security.auth.module.Krb5LoginModule.promptForPass(Krb5LoginModule.java:897)\r\n\tat com.sun.security。auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:760)\r\n\tat com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:617)\r\n\tat sun.reflect。 NativeMethodAccessorImpl.invoke0(本机方法)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\ n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat javax.security.auth.login.LoginContext.invoke(LoginContext.java:755)\r\n\tat javax .security.auth.login.LoginContext.access$000(LoginContext.java:195)\r\n\tat javax.security.auth.login.LoginContext$4.run(LoginContext.java:682)\r\n\tat javax .security.auth.login.LoginContext$4.run(LoginContext.java:680)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)\r\n\tat javax.security.auth.login.LoginContext.login(LoginContext.java:587)\r\n\tat org.apache。 hadoop.security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:970)\r\n\t... 161个常用帧省略\r\n","clientID":"f0f4b93c-56a1-11e9-80d8-0a1a4261e962","相关 ID":"bcf4dfc6-68ff-42eb-abed-d93ddcf76631","componentName":"recommendation-api","componentVersion":"0.0.1"}*"f0f4b93c-56a1-11e9-80d8-0a1a4261e962","correlationId":"bcf4dfc6-68ff-42eb-abed-d93ddcf76631","componentName":"recommendation-api","componentVersion":"0.0.1"}*"f0f4b93c-56a1-11e9-80d8-0a1a4261e962","correlationId":"bcf4dfc6-68ff-42eb-abed-d93ddcf76631","componentName":"recommendation-api","componentVersion":"0.0.1"}*

0 投票
0 回答
79 浏览

spring - 如何重定向到doFilter()(KerberosAuthFilter)中的简单授权页面?

如果用户无法通过 Kerberos 登录,则重定向到普通授权页面(通过登录名和密码表单)时会出现问题。在类的doFilter()方法中KerberosAuthFilter,如果标头结果为空或不满足要求(下面的代码),我会执行重定向,但不是从somehost:9090/tosomehost:9090/login页面重定向,而是无限输出字符串“redirect” .

请帮我解决这个问题。下面的代码

PS 通过 Kerberos 授权也可以通过登录名和密码表单进行授权,唯一的问题是我无法配置重定向到/login

日志:在此处输入图像描述

在重定向后的浏览器结果中: 在此处输入图像描述

0 投票
1 回答
561 浏览

kerberos - 如何在 IIS windows server 2012 中为 Web 应用程序配置 Kerberos?

我的场景:我有一个托管在 IIS windows 2012 服务器上的示例网站。当我浏览网站时,它应该提示输入 Active Directory 的凭据。我尝试使用“Windows 身份验证”,它工作正常,它使用 NTLM 进行 Windows 身份验证

如何使用 Kerberos 而不是 NTLM 登录网站

我已经尝试了链接中的步骤,但它不起作用 https://blog.kloud.com.au/2015/06/04/kerberos-web-application-configuration/

请帮我。

谢谢

0 投票
0 回答
42 浏览

java - Spring 安全是否支持 Windows Active Directory

我的应用程序基于使用 Windows Active Directory 身份验证的 NTLM 身份验证。我们正在迁移到 Windows 10,并且必须继续使用基于名称 + 域名的更好的身份验证。我可以继续使用 Spring 安全性吗?或者有人有更好的建议吗?

0 投票
1 回答
497 浏览

spring - 使用 Active Directory 进行 Spring Boot mvc ldap 身份验证

嗨,我有一个 spring mvc 休息服务,我想用活动目录建立安全系统。我的场景,用户登录其电脑并通过资源管理器或邮递员之类的方式拨打电话。

我的休息服务了解当前的凭据并检查授权

我的休息服务适用于 Windows 或 linux。

我怎样才能建立这个集成。

我读了一些文章,有人建议 kerberos 集成,但需要 keytab 才能运行。是否可以在没有 keytab 或其他一些集成公式的情况下运行。

0 投票
0 回答
3020 浏览

java - 在 Spring Boot 中使用 Hikari 数据源进行 Oracle 和 Sybase Kerberos 身份验证

在我的 Spring Boot 应用程序中,我使用两个数据库 Oracle 和 Sybase,并使用 Kerberos 连接数据库。当我一次对其中一个进行kerberized时效果很好,但是当我尝试同时使用它们时,我遇到了一个例外。

.yml文件中两个数据库的数据源如下:

我有一个jass.confSybase 文件

当我使用以下 VM 参数运行我的应用程序时,

当时我得到以下 Oracle 数据源的异常

当我当时删除了-Djavax.security.auth.useSubjectCredsOnly=falsefrom 参数时,得到了 SybaseDataSource 的以下异常,

任何人都可以帮我解决这个问题,或者我如何在 Sybase 的数据源属性中使用 Kerberos 缓存文件,就像 Oracle 一样。必须感谢任何帮助建议。提前致谢。

0 投票
1 回答
158 浏览

authentication - SSO - 另一个应用程序用户想要访问我的应用程序

我有两个名为 app1 和 app2 的应用程序。这两个应用程序分别有自己的用户。现在假设来自 app1 的用户名为 usr1 的用户登录到 app1。现在他想在不登录 app2 的情况下访问 app2。我的客户对使用 okta、ssoCircle、oneLogin 等任何 IDP 不感兴趣。

有什么方法可以在不登录 app2 的情况下授予 app2 上的 usr1 访问权限?用户将只登录到 app1,他将获得对 app2 的访问权限。

提前致谢。

0 投票
1 回答
82 浏览

reactjs - 使用 Spring 单点登录

在企业应用程序中,如何通过使用 Spring boot 和 React 读取 Windows AD 凭据,在没有登录页面的情况下无缝登录应用程序。

例如:如果我使用组织 AD 凭据登录到我的桌面,我的 Spring Boot React 应用程序可以读取它并自动登录而不弹出登录弹出窗口吗?

0 投票
0 回答
190 浏览

java - 为什么我的客户端浏览器不发送授权标头?

请帮助我,我花了 4 周的时间来解决这个问题,但它仍然无法正常工作。

我正在从非常基本的 springboot 的 kerberos spegno 示例开始实施 kerberos 身份验证。

但是我的 SpnegoAuthenticationProcessingFilter 不起作用,因为客户端浏览器没有发送任何包含 kerberos 票证的授权请求标头。我的客户已加入 KDC 域

这是我的客户端浏览器设置

在此处输入图像描述 在此处输入图像描述

浏览器的请求未发送授权标头 在此处输入图像描述

这是我的 catalina.out 日志

在此处输入图像描述