getJWT should return the user JWT associated with this connection.
This can return null for challenge only authentication, but for account/user
JWT-based authentication you need to return the JWT bytes here.

@return the user JWT
974221
public char[] getJWT() {
        try {
            char[] jwtChars = null;
            String fileToUse = this.jwtFile;

            if (this.chainFile != null) {
                fileToUse = this.chainFile;
            }

            byte[] data = Files.readAllBytes(Paths.get(fileToUse));
            ByteBuffer bb = ByteBuffer.wrap(data);
            CharBuffer chars = StandardCharsets.UTF_8.decode(bb);
            jwtChars = this.extract(chars, 1); // jwt is always first
            // Clear things up as best we can
            chars.clear();
            for (int i=0; i<chars.capacity();i++) {
                chars.put('\0');
            }
            bb.clear();
            for (int i=0;i<data.length;i++) {
                data[i] = 0;
            }

            return jwtChars;
        } catch (Exception exp) {
            throw new IllegalStateException("problem reading jwt", exp);
        }
    }
116304
public Authentication getAuthentication() {
        String username = getValueModel(LoginDetails.PROPERTY_USERNAME, String.class).getValue();
        String password = getValueModel(LoginDetails.PROPERTY_PASSWORD, String.class).getValue();
        return new UsernamePasswordAuthenticationToken( username, password );
    }
51391
public String generateJwt() throws NexmoUnacceptableAuthException {
        JWTAuthMethod authMethod = this.httpWrapper.getAuthCollection().getAuth(JWTAuthMethod.class);
        return authMethod.constructToken(System.currentTimeMillis() / 1000L, JWTAuthMethod.constructJTI());
    }
1041148
public BasicAuthAuthenticator getBasicAuthAuthenticator() {
        try {
            return createBasicAuthenticator();
        } catch (RegistryException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "RegistryException while trying to create BasicAuthAuthenticator", e);
            }
        }
        return null;
    }
528536
public synchronized HttpContext getHttpContext() {
        if (jolokiaHttpContext == null) {
            final String user = getConfiguration(USER);
            final String authMode = getConfiguration(AUTH_MODE);
            if (user == null) {
                if (ServiceAuthenticationHttpContext.shouldBeUsed(authMode)) {
                    jolokiaHttpContext = new ServiceAuthenticationHttpContext(bundleContext, authMode);
                } else {
                    jolokiaHttpContext = new DefaultHttpContext();
                }
            } else {
                jolokiaHttpContext =
                    new BasicAuthenticationHttpContext(getConfiguration(REALM),
                                                       createAuthenticator(authMode));
            }
        }
        return jolokiaHttpContext;
    }
1151554
@Provides
	@SessionScoped
	public UserLogin getLogin(@Named(JAXRS_SERVER_WEBAUTH_PROVIDER) CurrentUser user)
	{
		return (UserLogin) user;
	}
324366
public static @Nonnull Authentication getAuthentication() {
        Authentication a = SecurityContextHolder.getContext().getAuthentication();
        // on Tomcat while serving the login page, this is null despite the fact
        // that we have filters. Looking at the stack trace, Tomcat doesn't seem to
        // run the request through filters when this is the login request.
        // see http://www.nabble.com/Matrix-authorization-problem-tp14602081p14886312.html
        if(a==null)
            a = ANONYMOUS;
        return a;
    }
732540
static final String getUserId() {
    UserService userService = UserServiceFactory.getUserService();
    User loggedIn = userService.getCurrentUser();
    Preconditions.checkState(loggedIn != null, "This servlet requires the user to be logged in.");
    return loggedIn.getUserId();
  }
1226996
public String getUserPassword() {
		if(getSipURI().getUserPassword() == null) return null;
		return RFC2396UrlDecoder.decode(getSipURI().getUserPassword());
	}
551156
public function user()
    {
        if ($this->user !== null) {
            return $this->user;
        }

        if ($this->jwt->setRequest($this->request)->getToken() &&
            ($payload = $this->jwt->check(true)) &&
            $this->validateSubject()
        ) {
            return $this->user = $this->provider->retrieveById($payload['sub']);
        }
    }
554979
public function getUser() {
        $token = null;
        if (null === $this->user) {
            $token = $this->getTokenStorage()->getToken();
        }
        if (null !== $token) {
            $this->user = $token->getUser();
        }
        if (true === ($this->user instanceof UserInterface)) {
            return $this->user;
        }
        return null;
    }
541580
@Get("/users/me")
    public HttpResponse usersMe() throws Exception {
        final User user = AuthUtil.currentUser();
        return HttpResponse.of(HttpStatus.OK, MediaType.JSON_UTF_8,
                               HttpData.of(Jackson.writeValueAsBytes(user)));
    }
322924
def current_user_id():
    
    jwt_data = get_jwt_data_from_app_context()
    user_id = jwt_data.get('id')
    PraetorianError.require_condition(
        user_id is not None,
        "Could not fetch an id for the current user",
    )
    return user_id
1308769
private static String getCurrentUserName() {
        Authentication a = SecurityContextHolder.getContext().getAuthentication();
        if (a == null) return null;
        org.springframework.security.core.userdetails.User u =
                (org.springframework.security.core.userdetails.User)
                        a.getPrincipal();
        if (u == null) return null;
        return u.getUsername();
    }
143909
public function user()
    {
        if ($this->user !== null) {
            return $this->user;
        }

        if ($this->jwT->setRequest($this->request)->getToken() &&
            ($payload = $this->jwT->check(true)) &&
            $this->jwT->checkProvider($this->provider->getModel())
        ) {
            return $this->user = $this->provider->retrieveById($payload['sub']);
        }
    }
396471
public static boolean currentUserIsAuthenticated() {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    return authentication != null && authentication.isAuthenticated() && !currentUserIsAnonymous();
  }
659214
def get_jwt(self, request):
        
        try:
            authorization = request.authorization
        except ValueError:
            return None
        if authorization is None:
            return None
        authtype, token = authorization
        if authtype.lower() != self.auth_header_prefix.lower():
            return None
        return token