You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/12/02 22:12:23 UTC
[GitHub] [camel-quarkus] mnhlvsk opened a new issue #3353: SecurityIdentity is not propagated to Camel route
mnhlvsk opened a new issue #3353:
URL: https://github.com/apache/camel-quarkus/issues/3353
Hi guys,
I'm trying to use SecurityIdentity with Quarkus Camel, but can't get it working. Always getting an exception ContextNotActiveException when I call SecurityIdentity. Could you please help me how to solve it?
application.properties:
quarkus.http.auth.basic=true
quarkus.http.auth.permission.default.paths=/*
quarkus.http.auth.permission.default.policy=authenticated
quarkus.security.users.embedded.enabled=true
quarkus.security.users.embedded.plain-text=true
quarkus.security.users.embedded.users.jdoe=p4ssw0rd
quarkus.security.users.embedded.roles.jdoe=NoRolesUser
Route:
@ApplicationScoped
public class CamelRoute extends EndpointRouteBuilder {
@Inject
GreetingProcessor proc;
@Override
public void configure() throws Exception {
from("platform-http:/myservice")
.process(proc);
}
}
Processor:
@ApplicationScoped
public class GreetingProcessor implements Processor {
@Inject
SecurityIdentity identity;
@Override
public void process(Exchange exchange) throws Exception {
System.out.println(identity.getPrincipal().getName());
}
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton closed issue #3353: SecurityIdentity is not propagated to Camel route
Posted by GitBox <gi...@apache.org>.
jamesnetherton closed issue #3353:
URL: https://github.com/apache/camel-quarkus/issues/3353
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton commented on issue #3353: SecurityIdentity is not propagated to Camel route
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #3353:
URL: https://github.com/apache/camel-quarkus/issues/3353#issuecomment-988572213
There's a change coming in Camel 3.14.0 that should help with this scenario. In the `platform-http` route processor you will be able to do:
```java
QuarkusHttpUser user = exchange.getMessage().getHeader(VertxPlatformHttpConstants.AUTHENTICATED_USER, QuarkusHttpUser.class);
```
Then you can access the `Principal` on the `user` object.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] jamesnetherton commented on issue #3353: SecurityIdentity is not propagated to Camel route
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #3353:
URL: https://github.com/apache/camel-quarkus/issues/3353#issuecomment-985432055
This does indeed seem to be broken for `platform-http`. Even when forcefully activating the request context with ` @ActivateRequestContext`, the `SecurityIdentity` details are empty.
As a workaround you can try using `camel-quarkus-servlet`. `SecurityIdentity` should then work correctly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org