Package org.uberfire.security.auth

Examples of org.uberfire.security.auth.AuthenticationManager


        final CookieStorage cookieStorage = getCookieStorage( options );
        final AuthenticationScheme basicAuthScheme = new HttpBasicAuthenticationScheme();
        final AuthenticationScheme rememberMeAuthScheme = getRememberMeAuthScheme( options, cookieStorage );
        final String forceURL = getForceURL( options );
        final AuthenticationScheme authScheme = getAuthenticationScheme( options );
        final AuthenticationManager authManager = getAuthenticationManager( options );
        final AuthenticationProvider authProvider = getAuthenticationProvider( options );
        final ResourceManager resourceManager = getResourceManager( options );
        final AuthorizationManager authzManager = getAuthorizationManager( options );
        final VotingStrategy urlVotingStrategy = getURLVotingStrategy( options );
        final ResourceDecisionManager accessDecisionManager = getURLAccessDecisionManager( options );
View Full Code Here


    @Any
    private Instance<AuthorizationManager> authorizationManagers;

    @PostConstruct
    public void setup() {
        AuthenticationManager _authenticationManager = null;
        AuthorizationManager _authorizationManager = null;

        if ( authenticationManagers.isUnsatisfied() ) {
            final String authType = System.getProperty( "org.uberfire.io.auth", null );
            final String domain = System.getProperty( SecurityConstants.AUTH_DOMAIN_KEY, null );
            final String _mode = System.getProperty( ROLE_MODE_KEY, RolesMode.GROUP.toString() );
            RolesMode mode;
            try {
                mode = RolesMode.valueOf( _mode );
            } catch ( final Exception ignore ) {
                mode = RolesMode.GROUP;
            }

            if ( authType == null || authType.toLowerCase().equals( "jaas" ) || authType.toLowerCase().equals( "container" ) ) {
                _authenticationManager = new JAASAuthenticationManager( domain, mode );
            } else if ( authType.toLowerCase().equals( "property" ) ) {
                _authenticationManager = new PropertyAuthenticationManager( null );
            } else {
                _authenticationManager = loadClazz( authType, AuthenticationManager.class );
            }
        }

        if ( authorizationManagers.isUnsatisfied() ) {
            _authorizationManager = new FileSystemAuthorizationManager();
        }

        final AuthorizationManager authorizationManager = _authorizationManager;
        final AuthenticationManager authenticationManager = _authenticationManager;

        final org.uberfire.java.nio.security.AuthorizationManager ioAuthorizationManager = new org.uberfire.java.nio.security.AuthorizationManager() {
            @Override
            public boolean authorize( final FileSystem fs,
                                      final Subject subject ) {
                return authorizationManager.authorize( new FileSystemResourceAdaptor( fs ), ( (SubjectWrapper) subject ).getRealSubject() );
            }
        };

        for ( final FileSystemProvider fileSystemProvider : FileSystemProviders.installedProviders() ) {
            if ( fileSystemProvider instanceof SecurityAware ) {
                ( (SecurityAware) fileSystemProvider ).setUserPassAuthenticator( new UserPassAuthenticator() {
                    @Override
                    public boolean authenticate( String username,
                                                 String password,
                                                 Session session ) {
                        try {
                            final org.uberfire.security.Subject result = authenticationManager.authenticate( new UserPassSecurityContext( null, username, password ) );
                            if ( result != null ) {
                                session.setSubject( new SubjectWrapper( result ) );
                            }
                            return result != null;
                        } catch ( final Exception ignored ) {
View Full Code Here

TOP

Related Classes of org.uberfire.security.auth.AuthenticationManager

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.