From cd01b933a8573fefbe62d82edccc7fcf191c0c8f Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 2 Jan 2008 18:09:25 +0000 Subject: [PATCH] in PrincipalSid constructor and other places there's getPrincipal().toString(), which would behave in underministic fashion if we return a Principal object from the getPrinciapl() method. So to make this work consistently change it to return String. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6449 71c3de6d-444a-0410-be80-ed276b4c234a --- .../main/java/hudson/security/ContainerAuthentication.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/security/ContainerAuthentication.java b/core/src/main/java/hudson/security/ContainerAuthentication.java index 89c008de9a..dd4b717c9a 100644 --- a/core/src/main/java/hudson/security/ContainerAuthentication.java +++ b/core/src/main/java/hudson/security/ContainerAuthentication.java @@ -42,8 +42,8 @@ public final class ContainerAuthentication implements Authentication { return null; } - public Principal getPrincipal() { - return request.getUserPrincipal(); + public String getPrincipal() { + return request.getUserPrincipal().getName(); } public boolean isAuthenticated() { @@ -55,7 +55,7 @@ public final class ContainerAuthentication implements Authentication { } public String getName() { - return getPrincipal().getName(); + return getPrincipal(); } private static final GrantedAuthority[] ADMIN_AUTHORITY = {new GrantedAuthorityImpl("admin")};