-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.16.1.Final
-
None
-
- Install Keycloak
- Create a SASL authentication factory with an OAUTHBEARER mechanism
- Using the domain, set the <elytron-provider> in the ActiveMQ section
- Apply the client code as described above
I'm running WildFly 24 and trying to lookup a JMS ConnectionFactory authenticating against an OAUTHBEARER domain. I'm getting the following error
WFNAM00032: Peer authentication failed [Root exception is org.wildfly.security.auth.AuthenticationException:
I'm creating a context like this (which works for remote EJBs).
AuthenticationConfiguration authConfig =
{{ AuthenticationConfiguration}}
{{ .empty()}}
{{ .setSaslMechanismSelector(SaslMechanismSelector.NONE.addMechanism("OAUTHBEARER"))}}
{{ .useBearerTokenCredential(}}
{{ new BearerTokenCredential(token)}}
{{ );}}
AuthenticationContext authContext = AuthenticationContext
.empty().with(MatchRule.ALL, authConfig);authContext.runCallable( () ->{{
{ final Hashtable<String, String> jndiProperties = new Hashtable<>(); jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory"); jndiProperties.put(Context.PROVIDER_URL, providerURL); final Context context = new InitialContext(jndiProperties); ConnectionFactory jms = (ConnectionFactory) context.lookup("jms/RemoteConnectionFactory"); // error here }}});
- relates to
-
WFLY-8639 ConnectionFactory.createContext doesn't use user info from Elytron client AuthenticationConfiguration
- Closed