private RadiusAuthenticator setupRadiusAuthenticator ( RadiusClient radiusClient ) throws GuacamoleException { // If we don't have a radiusClient object, yet, don't go any further. if ( radiusClient == null ) { logger . error ( "RADIUS client hasn't been set up, yet." ) ; logger . debug ( "We can't run this method until the RADIUS client has been set up." ) ; return null ; } RadiusAuthenticator radAuth = radiusClient . getAuthProtocol ( confService . getRadiusAuthProtocol ( ) ) ; if ( radAuth == null ) throw new GuacamoleException ( "Could not get a valid RadiusAuthenticator for specified protocol: " + confService . getRadiusAuthProtocol ( ) ) ; // If we're using any of the TLS protocols, we need to configure them if ( radAuth instanceof PEAPAuthenticator || radAuth instanceof EAPTLSAuthenticator || radAuth instanceof EAPTTLSAuthenticator ) { // Pull TLS configuration parameters from guacamole.properties File caFile = confService . getRadiusCAFile ( ) ; String caPassword = confService . getRadiusCAPassword ( ) ; File keyFile = confService . getRadiusKeyFile ( ) ; String keyPassword = confService . getRadiusKeyPassword ( ) ; if ( caFile != null ) { ( ( EAPTLSAuthenticator ) radAuth ) . setCaFile ( caFile . toString ( ) ) ; ( ( EAPTLSAuthenticator ) radAuth ) . setCaFileType ( confService . getRadiusCAType ( ) ) ; if ( caPassword != null ) ( ( EAPTLSAuthenticator ) radAuth ) . setCaPassword ( caPassword ) ; } if ( keyPassword != null ) ( ( EAPTLSAuthenticator ) radAuth ) . setKeyPassword ( keyPassword ) ; ( ( EAPTLSAuthenticator ) radAuth ) . setKeyFile ( keyFile . toString ( ) ) ; ( ( EAPTLSAuthenticator ) radAuth ) . setKeyFileType ( confService . getRadiusKeyType ( ) ) ; ( ( EAPTLSAuthenticator ) radAuth ) . setTrustAll ( confService . getRadiusTrustAll ( ) ) ; } // If we're using EAP-TTLS, we need to define tunneled protocol if ( radAuth instanceof EAPTTLSAuthenticator ) { String innerProtocol = confService . getRadiusEAPTTLSInnerProtocol ( ) ; if ( innerProtocol == null ) throw new GuacamoleException ( "Trying to use EAP-TTLS, but no inner protocol specified." ) ; ( ( EAPTTLSAuthenticator ) radAuth ) . setInnerProtocol ( innerProtocol ) ; } return radAuth ; }
Creates a new instance of RadiusAuthentictor configured with parameters specified within guacamole . properties .