AuthenticationStrategy interface source code analysis

The AuthenticationStrategy authentication strategy interface mainly implements various authentication strategies. At present, all authentication strategies include ( FirstSuccessfulStrategy ( as long as one Realm is successfully authenticated, only the authentication information of the first Realm authentication is successful, and the others are ignored ); AtLeastOneSuccessfulStrategy ( As long as one Realm is successfully verified, it is different from FirstSuccessfulStrategy , which returns the authentication information of all Realm authentications ); AllSuccessfulStrategy ( All Realm verifications are successful, and all Realm authentications are successful, and return all Realm authentication information, if one fails fails ) ), first parse it as follows:

1. All operations before certification

AuthenticationInfo beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token) throws AuthenticationException;

2. Operations before a certain realm authentication

AuthenticationInfo beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate) throws AuthenticationException;

3. Operations after a certain realm authentication

AuthenticationInfo afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo singleRealmInfo, AuthenticationInfo aggregateInfo, Throwable t)
            throws AuthenticationException;

4. All operations after authentication

AuthenticationInfo afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate) throws AuthenticationException;

Guess you like

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