无法建立AuthenticationEntryPoint.请确保您已通过名称空间配置了登录机制 [英] No AuthenticationEntryPoint could be established. Please make sure you have a login mechanism configured through the namespace

查看:380
本文介绍了无法建立AuthenticationEntryPoint.请确保您已通过名称空间配置了登录机制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring-security 4.0.4. 我试图将响应标头的安全性配置设置如下: <sec:http use-expressions="true"> <sec:headers defaults-disabled="true"/> </sec:http>

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>

此设置用于禁用安全性标题中的安全性组件. 但是,如果完成此设置,则在服务器启动期间将引发以下异常. 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

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

根据错误,这些设置要求将form-login与上述设置配合使用.有人可以让我知道为什么吗?

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?

推荐答案

authentication entry point(即,身份验证过程是由未经身份验证的用户尝试访问安全资源而触发的)

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

您可以为自己的实现AuthenticationEntryPoint的入口点配置entry-point-ref,如以下config

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

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

或者您可以将auto-config设置为true,它将自动注册登录表单,BASIC身份验证和注销服务.

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" >

这篇关于无法建立AuthenticationEntryPoint.请确保您已通过名称空间配置了登录机制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆