How to get authenticated user inside RealmResourceProvider

Is there possible ti access authenticated user inside RealmResourceProvider … for example I am writing a custom rest api extension and I tried with:

private final AuthenticationManager.AuthResult auth;
	public ExampleRestResource(KeycloakSession session) {
		this.session = session;
        this.auth = new AppAuthManager.BearerTokenAuthenticator(session).authenticate();

but I receive class not found error

Uncaught server error: java.lang.NoClassDefFoundError: org/keycloak/services/managers/AppAuthManager$BearerTokenAuthenticator

I have deployed the SPI as jar to standalone folder … doo I need to include jboss-deployment-structure.xml ?

I found the solution … you must add the jboss-deployment-structure.xml in META-INF of the jar with the required modules

<?xml version="1.0" encoding="UTF-8"?>
            <module name="org.keycloak.keycloak-core" export="true"/>
            <module name="org.keycloak.keycloak-server-spi" export="true"/>
            <module name="org.keycloak.keycloak-server-spi-private" export="true"/>
            <module name="org.keycloak.keycloak-services" export="true"/>