Learn how to add login, role-based access control, and session management to a Java web application using Apache Shiro
Implement OAuth2 or single sign-on across multiple Java services following the advanced chapters in this tutorial series
Configure dynamic URL-based permission rules in a Spring and Shiro application without hardcoding access rules in code
Set up remember-me cookies, CAPTCHA verification, and concurrent login limits in a Shiro-secured Java web app
Each chapter is a separate Maven project, familiarity with Maven is required to build and run the examples.
This repository contains the companion example code for a Chinese-language tutorial series on Apache Shiro, a Java library that handles security concerns like login, permissions, and session management for web applications. The README is written in Chinese, and the project is associated with a book by the author on high-traffic web architecture. Apache Shiro is a framework that Java developers drop into a project to handle the parts of an application that decide who a user is and what they are allowed to do. Rather than building these systems from scratch, developers configure Shiro to connect to their database of users, define rules about which roles can access which pages or actions, and let the framework enforce those rules automatically. The tutorial series spans 24 chapters and works through Shiro's features progressively. Early chapters cover the basics of authentication (confirming a user's identity) and authorization (checking what they can do), along with configuration file syntax and how Shiro stores and encodes passwords. Later chapters go deeper into integration with web applications and the Spring framework, handling remember-me cookies, SSL, and single sign-on across multiple services. Advanced chapters address OAuth2, concurrent login limits, dynamic URL-based permission rules, stateless web APIs, CAPTCHA verification, centralized permission management across multiple projects, and distributed session handling. The example projects in the repository are built with Maven, so some familiarity with that Java build tool is expected to run them. Each chapter has its own example project corresponding to that chapter's topic. This is primarily a learning resource for Java developers who want to understand how to use Apache Shiro across a wide range of real-world scenarios, rather than a standalone application you would deploy on its own.
← zhangkaitao on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.