• Spring Security 验证流程


     Authentication in a Web Application

    Now let's explore the situation where you are using Spring Security in a web application (without web.xml security enabled). How is a user authenticated and the security context established?

    Consider a typical web application's authentication process:

    1. You visit the home page, and click on a link.

    2. A request goes to the server, and the server decides that you've asked for a protected resource.

    3. As you're not presently authenticated, the server sends back a response indicating that you must authenticate. The response will either be an HTTP response code, or a redirect to a particular web page.

    4. Depending on the authentication mechanism, your browser will either redirect to the specific web page so that you can fill out the form, or the browser will somehow retrieve your identity (via a BASIC authentication dialogue box, a cookie, a X.509 certificate etc.).

    5. The browser will send back a response to the server. This will either be an HTTP POST containing the contents of the form that you filled out, or an HTTP header containing your authentication details.

    6. Next the server will decide whether or not the presented credentials are valid. If they're valid, the next step will happen. If they're invalid, usually your browser will be asked to try again (so you return to step two above).

    7. The original request that you made to cause the authentication process will be retried. Hopefully you've authenticated with sufficient granted authorities to access the protected resource. If you have sufficient access, the request will be successful. Otherwise, you'll receive back an HTTP error code 403, which means "forbidden".

  • 相关阅读:
    手机端页面下端出现滑动条
    Centos7中文乱码问题的解决
    VirtualBox虚拟机克隆迁移步骤
    利用U盘安装win2008r2系统的步骤
    virtuoso操作graph的方法--查询和删除
    excel中的数据导出为properties和map的方法
    virtuoso装载大的rdf文件的方法
    eclipse创建maven的web项目
    揭开WebService的神秘面纱
    几个学习的网站
  • 原文地址:https://www.cnblogs.com/lostpaddle/p/2833433.html
Copyright © 2020-2023  润新知