SEC-1239: Special characters in JAAS config file location. Fix - convert Resource to a File before obtaining the URL from it. The URL.toString() obtained this way is different from the one obtained from Resource.getURL().toString().

This commit is contained in:
Luke Taylor
2009-09-09 17:41:35 +00:00
parent 6640eab9dc
commit ef2df77889
2 changed files with 58 additions and 11 deletions

View File

@@ -15,6 +15,7 @@
package org.springframework.security.authentication.jaas;
import java.io.File;
import java.io.IOException;
import java.security.Principal;
import java.security.Security;
@@ -243,7 +244,8 @@ public class JaasAuthenticationProvider implements AuthenticationProvider, Appli
*
*/
private void configureJaasUsingLoop() throws IOException {
String loginConfigUrl = loginConfig.getURL().toString();
File loginConfigFile = loginConfig.getFile();
String loginConfigUrl = loginConfigFile.toURL().toString();
boolean alreadySet = false;
int n = 1;