简体   繁体   English

Spring Authentication如何工作?

[英]How does Spring Authentication work?

I've been trying to make a web service that receives a username and password and returns some sort of session that tells the receiver what they can and cannot do. 我一直在尝试制作一个接收用户名和密码并返回某种会话的Web服务,该会话告诉接收者他们可以做什么和不能做什么。

  1. Where and how does Spring handle sessions and permissions? Spring在哪里以及如何处理会话和权限?
  2. On my login form I have 在我的登录表单上,我有

<form method="POST" action="<c:url value="/j_spring_security_check" />">

What does this do and is it possible to create a web service that does the same thing? 这是做什么的,有可能创建一个做同样事情的Web服务吗?

I think your project is integrated with spring-security plugin. 我认为您的项目已与spring-security插件集成。 <c:url value="/j_spring_security_check"> --This line submit userid,paswd to spring security interceptor which in turn decide to call service or do whatever as mentioned in spring-security.xml file. <c:url value="/j_spring_security_check">行将userid,paswd提交给spring安全拦截器,后者决定调用服务或做spring-security.xml文件中提到的任何事情。 check for following code in your web.xml file for confirmation.. 检查web.xml文件中的以下代码以进行确认。

    <filter-mapping>
      <filter-name>springSecurityFilterChain</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping> 

Post your spring configuration.xml file and web.xml for more analysis. 发布您的spring configuration.xml文件和web.xml以进行更多分析。 For authentication why you want to write webservice? 对于身份验证,为什么要编写Web服务? For more information on spring security read the doc http://static.springsource.org/spring-security/site/ 有关Spring安全性的更多信息,请阅读doc http://static.springsource.org/spring-security/site/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM