[keycloak-user] ejb getCallerPrincipal() returning anonymous en Wildfly11

JOSE INACIO DA SILVA JUNIOR inacio-silva at prodesan.com.br
Fri Jan 19 14:33:18 EST 2018


Hi,

I'm following the GettingStarted in the Keycloak documentation and everything works fine with Wildfly-10.1.0.

But in Wildfly-11.0.0, the following code prints: USER: anonymous in the console.


@Stateless
public class TesteService {

	
	@Resource private SessionContext sessionContext;
	
	public void run() {
		
		System.out.println("USER: "+sessionContext.getCallerPrincipal());
		
	}
	
}


What can I do to get my code working as expected with Wildfly11?


Thanks in advance!
Inacio


More information about the keycloak-user mailing list