X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.security.core%2Fsrc%2Forg%2Fargeo%2Fsecurity%2Fcore%2FInternalAuthentication.java;fp=org.argeo.security.core%2Fsrc%2Forg%2Fargeo%2Fsecurity%2Fcore%2FInternalAuthentication.java;h=ee5e145bacb6b5a80492e86d5c14b748dff15756;hb=b3b39d5606a0c48d64a804f4aff5459ea3addc31;hp=267ddd312af8d0741c1876bbd9a86b388f7195ef;hpb=5ae7bd094c6b8a2f9c0b6b3460b5abe6fe0b7fff;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.security.core/src/org/argeo/security/core/InternalAuthentication.java b/org.argeo.security.core/src/org/argeo/security/core/InternalAuthentication.java index 267ddd312..ee5e145ba 100644 --- a/org.argeo.security.core/src/org/argeo/security/core/InternalAuthentication.java +++ b/org.argeo.security.core/src/org/argeo/security/core/InternalAuthentication.java @@ -15,13 +15,14 @@ */ package org.argeo.security.core; +import java.util.Collections; + import org.argeo.security.SystemAuthentication; -import org.springframework.security.GrantedAuthority; -import org.springframework.security.GrantedAuthorityImpl; -import org.springframework.security.adapters.PrincipalSpringSecurityUserToken; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.authority.SimpleGrantedAuthority; /** A token base on a system key used to request a system authentication. */ -public class InternalAuthentication extends PrincipalSpringSecurityUserToken +public class InternalAuthentication extends UsernamePasswordAuthenticationToken implements SystemAuthentication { private static final long serialVersionUID = -6783376375615949315L; /** 'admin' for consistency with JCR */ @@ -32,12 +33,8 @@ public class InternalAuthentication extends PrincipalSpringSecurityUserToken public InternalAuthentication(String key, String systemUsername, String systemRole) { - super( - key, - systemUsername, - key, - new GrantedAuthority[] { new GrantedAuthorityImpl(systemRole) }, - systemUsername); + super(systemUsername, key, Collections + .singleton(new SimpleGrantedAuthority(systemRole))); } public InternalAuthentication(String key) {