평생 휴식 서비스를위한 Spring Basic Authorization을 구현하여 정말 어색한 문제에 직면하고 있습니다. 사실, 로컬 컴퓨터에서 응용 프로그램을 테스트 할 때 구성이 완벽하게 작동합니다.Liferay에서 REST 서비스를위한 Spring Basic 인증이 작동하지 않음
문제는 테스트 서버에 응용 프로그램을 배포하자마자 나타납니다. 서버는 항상 401 인증되지 않은 액세스를 반환하지만 인증 공급자는 절대로 도달하지 않습니다. 브라우저에서 네트워크 트래픽을 분석하여
if(header != null && header.startsWith("Basic "))
, Authorization 헤더는 다음과 같습니다 디버깅으로
, 내가 요청이 자격 증명을 사용하여 헤더 (헤더 = NULL)이 BasicAuthenticationFilter에 도달 할 때를 포함하지 않는 것으로 나타났습니다 그곳에.
<http pattern="/*" security="none"/>
<!-- urls that need authentication and roles -->
<http use-expressions="true" >
<intercept-url pattern="/myrest/url/**" access="hasAnyRole('myrole')" />
<http-basic/>
</http>
<!-- AuthenticationManager/Provider that checks the authentication against Liferay -->
<beans:bean id="myCustomAuthorizationProvider"
class="myCustomAuthorizationProvider">
<beans:constructor-arg ref="myUsersDao"/>
<beans:constructor-arg ref="MyRolesDao"/>
</beans:bean>
<authentication-manager>
<authentication-provider ref="myCustomAuthorizationProvider"/>
</authentication-manager>
내가 그것에 대해 어떤 도움을 주셔서 감사합니다 :
여기 내 보안 구성입니다.
를 들어
? –