/** * Initializes this realm and potentially enables an authentication cache, depending on configuration. Based on * the availability of an authentication cache, this class functions as follows: * <ol> * <li>If the {@link #setAuthenticationCache cache} property has been set, it will be * used to cache the AuthenticationInfo objects returned from {@link #getAuthenticationInfo} * method invocations. * All future calls to {@link #getAuthenticationInfo} will attempt to use this cache first * to alleviate any potentially unnecessary calls to an underlying data store.</li> * <li>If the {@link #setAuthenticationCache cache} property has <b>not</b> been set, * the {@link #setCacheManager cacheManager} property will be checked. * If a {@code cacheManager} has been set, it will be used to eagerly acquire an authentication * {@code cache}, and this cache which will be used as specified in #1.</li> * <li>If neither the {@link #setAuthenticationCache (org.apache.shiro.cache.Cache) authenticationCache} * or {@link #setCacheManager(org.apache.shiro.cache.CacheManager) cacheManager} * properties are set, caching will not be utilized and authentication look-ups will be delegated to * subclass implementations for each authentication attempt.</li> * </ol> * <p/> * This method finishes by calling {@link #onInit()} is to allow subclasses to perform any init behavior desired. * * @since 1.2 */ public final void init() { //trigger obtaining the authorization cache if possible getAvailableAuthenticationCache(); onInit(); }
/** * Initializes this realm and potentially enables a cache, depending on configuration. * <p/> * When this method is called, the following logic is executed: * <ol> * <li>If the {@link #setAuthorizationCache cache} property has been set, it will be * used to cache the AuthorizationInfo objects returned from {@link #getAuthorizationInfo} * method invocations. * All future calls to {@code getAuthorizationInfo} will attempt to use this cache first * to alleviate any potentially unnecessary calls to an underlying data store.</li> * <li>If the {@link #setAuthorizationCache cache} property has <b>not</b> been set, * the {@link #setCacheManager cacheManager} property will be checked. * If a {@code cacheManager} has been set, it will be used to create an authorization * {@code cache}, and this newly created cache which will be used as specified in #1.</li> * <li>If neither the {@link #setAuthorizationCache (org.apache.shiro.cache.Cache) cache} * or {@link #setCacheManager(org.apache.shiro.cache.CacheManager) cacheManager} * properties are set, caching will be disabled and authorization look-ups will be delegated to * subclass implementations for each authorization check.</li> * </ol> */ protected void onInit() { super.onInit(); //trigger obtaining the authorization cache if possible getAvailableAuthorizationCache(); }
/** * Initializes this realm and potentially enables a cache, depending on configuration. * <p/> * When this method is called, the following logic is executed: * <ol> * <li>If the {@link #setAuthorizationCache cache} property has been set, it will be * used to cache the AuthorizationInfo objects returned from {@link #getAuthorizationInfo} * method invocations. * All future calls to {@code getAuthorizationInfo} will attempt to use this cache first * to alleviate any potentially unnecessary calls to an underlying data store.</li> * <li>If the {@link #setAuthorizationCache cache} property has <b>not</b> been set, * the {@link #setCacheManager cacheManager} property will be checked. * If a {@code cacheManager} has been set, it will be used to create an authorization * {@code cache}, and this newly created cache which will be used as specified in #1.</li> * <li>If neither the {@link #setAuthorizationCache (org.apache.shiro.cache.Cache) cache} * or {@link #setCacheManager(org.apache.shiro.cache.CacheManager) cacheManager} * properties are set, caching will be disabled and authorization look-ups will be delegated to * subclass implementations for each authorization check.</li> * </ol> */ protected void onInit() { super.onInit(); //trigger obtaining the authorization cache if possible getAvailableAuthorizationCache(); }
/** * Initializes this realm and potentially enables an authentication cache, depending on configuration. Based on * the availability of an authentication cache, this class functions as follows: * <ol> * <li>If the {@link #setAuthenticationCache cache} property has been set, it will be * used to cache the AuthenticationInfo objects returned from {@link #getAuthenticationInfo} * method invocations. * All future calls to {@link #getAuthenticationInfo} will attempt to use this cache first * to alleviate any potentially unnecessary calls to an underlying data store.</li> * <li>If the {@link #setAuthenticationCache cache} property has <b>not</b> been set, * the {@link #setCacheManager cacheManager} property will be checked. * If a {@code cacheManager} has been set, it will be used to eagerly acquire an authentication * {@code cache}, and this cache which will be used as specified in #1.</li> * <li>If neither the {@link #setAuthenticationCache (org.apache.shiro.cache.Cache) authenticationCache} * or {@link #setCacheManager(org.apache.shiro.cache.CacheManager) cacheManager} * properties are set, caching will not be utilized and authentication look-ups will be delegated to * subclass implementations for each authentication attempt.</li> * </ol> * <p/> * This method finishes by calling {@link #onInit()} is to allow subclasses to perform any init behavior desired. * * @since 1.2 */ public final void init() { //trigger obtaining the authorization cache if possible getAvailableAuthenticationCache(); onInit(); }
@Override protected void onInit() { super.onInit(); jwtProcessor = JwtProcessors.createDefault(); setCredentialsMatcher(new JwtCredentialsMatcher(jwtProcessor)); }
@Override protected void onInit() { super.onInit(); jwtProcessor = JwtProcessors.createDefault(); setCredentialsMatcher(new JwtCredentialsMatcher(jwtProcessor)); }