Package org.apache.shiro.mgt

Examples of org.apache.shiro.mgt.RealmSecurityManager


    protected boolean isAutoApplyRealms(SecurityManager securityManager) {
        boolean autoApply = true;
        if (securityManager instanceof RealmSecurityManager) {
            //only apply realms if they haven't been explicitly set by the user:
            RealmSecurityManager realmSecurityManager = (RealmSecurityManager) securityManager;
            Collection<Realm> realms = realmSecurityManager.getRealms();
            if (!CollectionUtils.isEmpty(realms)) {
                log.info("Realms have been explicitly set on the SecurityManager instance - auto-setting of " +
                        "realms will not occur.");
                autoApply = false;
            }
View Full Code Here


        return AuthenticationRequestPassword.class.isAssignableFrom(authenticationRequestClass);
    }

    @Override
    public AuthenticationSession authenticate(final AuthenticationRequest request, final String code) {
        RealmSecurityManager securityManager = getSecurityManager();
        if(securityManager == null) {
            return null;
        }
        final AuthenticationToken token = asAuthenticationToken(request);
       
View Full Code Here

     * somewhere other than Shiro's {@link RealmSecurityManager}.
     */
    protected List<String> getRoles(final AuthenticationToken token) {
        final List<String> roles = Lists.newArrayList();

        RealmSecurityManager securityManager = getSecurityManager();
        if(securityManager == null) {
            return roles;
        }
       
        final Collection<Realm> realms = securityManager.getRealms();
        for (final Realm realm : realms) {
            if(!realm.supports(token)) {
                continue;
            }
            final AuthenticationInfo authenticationInfo = realm.getAuthenticationInfo(token);
View Full Code Here

    public boolean isUsableInAnyRole(Identifier identifier) {
        return isPermitted(identifier, "w");
    }

    private boolean isPermitted(Identifier identifier, String qualifier) {
        RealmSecurityManager securityManager = getSecurityManager();
        if(securityManager == null) {
            // cannot do permission checking if no security manager
            return false;
        }
View Full Code Here

TOP

Related Classes of org.apache.shiro.mgt.RealmSecurityManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.