No AuthenticationEntryPoint could be established. Please make sure you have a login mechanism configured through the namespace

喜欢而已 提交于 2019-12-25 08:00:07

问题


I am using Spring-security 4.0.4. I was trying to set the security configurations for the response headers as below- <sec:http use-expressions="true"> <sec:headers defaults-disabled="true"/> </sec:http>

This setting is to disable the security components in the security header. However, if this setting is done then the following exception is thrown during the server startup. Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: No AuthenticationEntryPoint could be established. Please make sure you have a login mechanism configured through the namespace (such as form-login) or specify a custom AuthenticationEntryPoint with the 'entry-point-ref' attribute

As per the error, the settings requires form-login to be used with the above setting.Could someone please let me know why it is so?


回答1:


authentication entry point (i.e. where the authentication process is triggered by an attempt by an unauthenticated user to access to a secured resource)

You can config the entry-point-ref for you own entry point that implements AuthenticationEntryPoint, like following config

<http entry-point-ref="youOwnEntrypoint">

Or you can just set the auto-config to true, it will register a login form, BASIC authentication, logout services automatically.

<http auto-config="true" >


来源:https://stackoverflow.com/questions/41142155/no-authenticationentrypoint-could-be-established-please-make-sure-you-have-a-lo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!