Tian Shi Spring Security Tutorial Chapter II: Customizing the Login certification process

Source: Internet
Author: User
Customizing the certification Process 1. Customizing the login page 1.1 modifying the security profile

The security default has a form login page. If we do not specify it will jump to the default up. Since the page does not meet our development needs, we need to customize a page.

When we define what authentication method to use when intercepting HTTP requests, we can specify a login page.

1.2 Create an HTML page under the resource resource bundle

1.3 Access to the browser.

When we visit the browser task page, we get an error. The error is too many hops.
Cause of error: When we enter a page in the browser, security will intercept it. and jump to the login page specified above. However, security will also intercept this login page and jump to the login page again. So it causes a dead loop.

Workaround: Need to modify the content of security at a time

Set a match to match on this login page. and set his permissions to be accessible to everyone. This will solve the problem.

1.4 Modifying the contents of the login page

Add the form form to the login page and set the access path.

2. Custom login successfully processed 3. Custom Login Failure Handling

From for notes (Wiz)

Tian Shi Spring Security Tutorial Chapter II: Customizing the Login certification process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.