@@ -0,0 +1,3509 @@
+/*%0A * Copyright (C) 2017. OpenLattice, Inc%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU General Public License for more details.%0A *%0A * You should have received a copy of the GNU General Public License%0A * along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A *%0A * You can contact the owner of the copyright at support@openlattice.com%0A *%0A */%0A%0Apackage com.openlattice.auth0;%0A%0Aimport com.auth0.jwt.JWTVerifier;%0Aimport com.auth0.jwt.exceptions.JWTVerificationException;%0Aimport com.auth0.spring.security.api.authentication.PreAuthenticatedAuthenticationJsonWebToken;%0Aimport java.util.Collection;%0Aimport javax.security.auth.Subject;%0Aimport org.springframework.security.core.Authentication;%0Aimport org.springframework.security.core.GrantedAuthority;%0A%0A/**%0A * @author Matthew Tamayo-Rios &lt;matthew@openlattice.com&gt;%0A */%0Apublic class WrappedPreAuthenticatedAuthenticationJwt implements Authentication %7B%0A    private final PreAuthenticatedAuthenticationJsonWebToken token;%0A%0A    public WrappedPreAuthenticatedAuthenticationJwt( PreAuthenticatedAuthenticationJsonWebToken token ) %7B%0A        this.token = token;%0A    %7D%0A%0A    public PreAuthenticatedAuthenticationJsonWebToken unwrap() %7B%0A        return token;%0A    %7D%0A%0A    @Override public boolean equals( Object o ) %7B%0A        if ( this == o ) %7B return true; %7D%0A        if ( !( o instanceof WrappedPreAuthenticatedAuthenticationJwt ) ) %7B return false; %7D%0A%0A        WrappedPreAuthenticatedAuthenticationJwt that = (WrappedPreAuthenticatedAuthenticationJwt) o;%0A%0A        return token.equals( that.token );%0A    %7D%0A%0A    @Override public int hashCode() %7B%0A        return token.hashCode();%0A    %7D%0A%0A    @Override public String toString() %7B%0A        return %22WrappedPreAuthenticatedAuthenticationJwt%7B%22 +%0A                %22token=%22 + token +%0A                '%7D';%0A    %7D%0A%0A    @Override public Collection%3C? extends GrantedAuthority%3E getAuthorities() %7B%0A        return token.getAuthorities();%0A    %7D%0A%0A    @Override public Object getCredentials() %7B%0A        return token.getCredentials();%0A    %7D%0A%0A    @Override public Object getDetails() %7B%0A        return token.getDetails();%0A    %7D%0A%0A    @Override public Object getPrincipal() %7B%0A        return token.getPrincipal();%0A    %7D%0A%0A    @Override public boolean isAuthenticated() %7B%0A        return token.isAuthenticated();%0A    %7D%0A%0A    @Override public void setAuthenticated( boolean isAuthenticated ) throws IllegalArgumentException %7B%0A        token.setAuthenticated( isAuthenticated );%0A    %7D%0A%0A    @Override public String getName() %7B%0A        return token.getName();%0A    %7D%0A%0A    public static PreAuthenticatedAuthenticationJsonWebToken usingToken( String token ) %7B%0A        return PreAuthenticatedAuthenticationJsonWebToken.usingToken( token );%0A    %7D%0A%0A    public String getToken() %7B%0A        return token.getToken();%0A    %7D%0A%0A    public String getKeyId() %7B%0A        return token.getKeyId();%0A    %7D%0A%0A    public Authentication verify( JWTVerifier verifier ) throws JWTVerificationException %7B%0A        return token.verify( verifier );%0A    %7D%0A%0A    @Override public boolean implies( Subject subject ) %7B%0A        return token.implies( subject );%0A    %7D%0A%7D%0A

Add Wrapped token holder