-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JEE Security Integration #46
Comments
Hey @redmitry , thanks for reporting this.I'll experiment with your use case and report back with my findings. |
I managed to retrieve the user's name and roles using Elytron API: pom.xml:
code:
I'm not sure about the state of support of Jakarta EE security in WF right now, maybe it could be supported (I think it works only in EJBs and servlets right now) but I'll have to dig more. |
It doesn't work :-(. I get org.wildfly.security.auth.principal.AnonymousPrincipal |
Does your deployment have security configured properly? I basically described my findings in this document https://github.com/wildfly-extras/wildfly-graphql-feature-pack/wiki/Server-side-security-guide if you don't need the declarative security I think you can leave out the |
I use usual JAX-RS endpoints along to the GraphQL an have no problems injecting SecurityContext. I use Keycloak filter: <filter>
<filter-name>Keycloak Filter</filter-name>
<filter-class>org.keycloak.adapters.servlet.KeycloakOIDCFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Keycloak Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> P.S. Here is the endpoint: |
Looking at the REST classes in your repo, I suppose you're referring to After some more experiments I found out I can actually inject But if you're getting an anonymous principal, I think that switching from Elytron to |
I have to admit that integrating KEYCLOAK "normal" way - via web.xml <login-config>
<auth-method>KEYCLOAK</auth-method>
</login-config> the solution with SecurityDomain works. I hope, in some moment GraphQL integration solves the SecurityContext integration though. Kind regards, Dmitry |
Hello,
Having the GraphQL endpoint annotated with @GraphQLAPI and @RequestScoped I cant inject SecurityContext in the CDI.
I can inject Principal, but because this is a WELD proxy, I can not cast it to get an access to the roles. graphql-java provides the DataFetchingEnvironment, which in my understanding contains security context (?), but it doesn't work in Wildfly.
I see that the problem is that the CDI is called from another thread (Callable) and loose the context.
What is the correct way to provide programmatic security?
Kind regards,
Dmitry
The text was updated successfully, but these errors were encountered: