shiro summary 1

1: Create securitymannager through ini configuration file;

2: Call the subject.login method to submit the authentication and submit the token

3: The securitymannager is authenticated, and the securitymannager is finally authenticated by the modularrealmauthenticator;

4: The modularrealmauthenticator calls inirealm (passes tolen to realm) to query user information in the ini configuration file

5: inirealm queries user information from shiro-first.ini according to the input token (usernamepasswordtoken), and queries user information (account, password) according to the account number

If user information is queried, return user information (account, password) to modularrealmauthenticator

If the query cannot be found, return null to the modularrealmauthenticator

6: modularrealmauthenticator receives the authentication information returned by inirealm

The returned authentication information is null, and the modularrealmauthenticator throws an exception unknownaccountexception

 

If the returned authentication information is not null (indicating that inireal has found the user), return the user password (existing in the ini file) to inirealm

 

Shiro certification process: (Master)
           1. The subject ( subject ) requests authentication and calls subject.login(token)
           2. SecurityManager ( Security Manager ) performs authentication
           3. SecurityManager authenticates through ModularRealmAuthenticator .
           4. ModularRealmAuthenticator passes the token to realm , and realm queries the user information (including identity and credentials) from the database according to the user information in the token .
    5. If realm fails to query the user and returns null to ModularRealmAuthenticator , ModularRealmAuthenticator throws an exception (user does not exist)
           6. If realm finds the user , it returns AuthenticationInfo ( authentication information ) to ModularRealmAuthenticator
           7. ModularRealmAuthenticator takes AuthenticationInfo ( authentication information ) to perform credential (password ) comparison. If it is consistent, the authentication is passed, if it does not throw an exception (credential error).


 

subject : the subject

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327042960&siteId=291194637