zoukankan      html  css  js  c++  java
  • 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".

  • 相关阅读:
    hdu2243之AC自动机+矩阵乘法
    jstl
    HDU 3360 National Treasures 奇偶匹配的最低点覆盖
    【UVA】11992
    what is the difference between definition and declaration in c
    UVALive 6485 Electric Car Rally (BFS,PQ)
    Android发展_备份短信
    vxWorks 命令
    【C++智能指针 auto_ptr】
    Get and Post(Unity3D六个发展)
  • 原文地址:https://www.cnblogs.com/lostpaddle/p/2833433.html
Copyright © 2011-2022 走看看