@ Bean ( initMethod = "init" ) public ConfigFacade configFacade ( ) throws Exception { final URL loginResource = this . getClass ( ) . getClassLoader ( ) . getResource ( "login.conf" ) ; if ( loginResource != null ) { setSystemPropertyIfNotSet ( JAVA_SECURITY_AUTH_LOGIN_CONFIG , loginResource . toExternalForm ( ) ) ; } LOG . info ( "Using loginResource " + JAVA_SECURITY_AUTH_LOGIN_CONFIG + " : " + System . getProperty ( JAVA_SECURITY_AUTH_LOGIN_CONFIG ) ) ; final URL loginFile = this . getClass ( ) . getClassLoader ( ) . getResource ( "realm.properties" ) ; if ( loginFile != null ) { setSystemPropertyIfNotSet ( "login.file" , loginFile . toExternalForm ( ) ) ; } LOG . info ( "Using login.file : " + System . getProperty ( "login.file" ) ) ; setSystemPropertyIfNotSet ( AuthenticationConfiguration . HAWTIO_ROLES , "admin" ) ; setSystemPropertyIfNotSet ( AuthenticationConfiguration . HAWTIO_REALM , "hawtio" ) ; setSystemPropertyIfNotSet ( AuthenticationConfiguration . HAWTIO_ROLE_PRINCIPAL_CLASSES , "org.eclipse.jetty.jaas.JAASRole" ) ; if ( ! Boolean . getBoolean ( "debugMode" ) ) { System . setProperty ( AuthenticationConfiguration . HAWTIO_AUTHENTICATION_ENABLED , "true" ) ; } return new ConfigFacade ( ) ; }
Configure facade to use authentication .