-
Notifications
You must be signed in to change notification settings - Fork 4
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
Plugin works? #7
Comments
Definitely works. We've been using it in production applications for about two years now. Sadly not much documentation, but if you're really interested in making use of it I can probably help you get it working and flesh out some additional documentation along the way. |
I would like to know how the integration with the server works. I was curious to use the solution, but following the README, I was a little confused on how to use it. I believe that other people can also benefit from the solution. |
Let's start with the super high-level stuff first. This is a module that plugs into the Wildfly application server using Wildfly's extension mechanism. It gets its configuration from the Wildfly configuration model. Wildfly's configuration model is persistently represented in an XML file (e.g. standalone.xml) and is typically manipulated using the Wildfly management CLI. The README shows some CLI commands that are used to set up a pretty basic configuration for the module, but there are lots of configurable options. Once the module has been enabled in the server's configuration, it registers itself to observe application deployments. When a web application is deployed (e.g. dropping a This approach allows you to use all of the standard J2EE declarative mechanisms that require a particular security role to access a given resource in exactly the same way that you would in a web application that uses, for example, BASIC authentication or FORM authentication. The web application itself doesn't need to do anything but declare what role is required to access a given resource. The module takes care of validating a presented JWT bearer token to confirm that it is authentic and contains the claim(s) corresponding to the necessary role(s). The module can use any of Wildfly's supported mechanisms for mapping attributes of a user to application roles; a common simple approach is the use of I'll stop here for now to give you a chance to ask questions to help guide the conversation in the direction that better suits your needs. |
Hello @ceharris. I try to extend jwt-webapp-demo with a soap endpoint in the same 'jwt' secutity domain that is declared in jboss-web.xml. ` @ Inject Call to this soap endpoint doesn't come into JwtLoginModule as expected. Could you tell me if there is a way to secure soap endpoints in 'jwt' security domain, like it is done for rest and servlets? |
I'm certain that there is a way to make authenticate and authorize SOAP requests using a JAAS login module in a security-domain component (such as the JwtLoginModule). Ultimately SOAP requests come in through HTTP via the undertow subsystem just like any other HTTP request. When a web application that uses this JWT module is deployed, the module modifies the servlet deployment to replace the the authentication method -- a servlet application typically specifies a login method in web.xml as BASIC, FORM, DIGEST, etc. If you can make your SOAP endpoint work correctly using HTTP Basic authentication, it should be relatively easy to make it work correctly using the JWT module. To work towards a solution, I would begin by temporarily renaming the JWT deployment descriptor |
Hi @ceharris and thank you for your answer - it helped me a lot. You were right - placing the jwt deployment descriptor as well as jboss-webservices.xml in src/main/webapp/WEB-INF solved the problem for a web application. Calls to secured SOAP and REST webservices inside the war-deployment go over the JWTLoginModule as expected. But in case of ear-deployment with the following structure it seems to ignore 'jwt' security domain for everything outside the war: simple-demo.ear contains:
I have tested HTTP Basic authentication with the same ear-deployment structure, and the call comes to SOAP/REST/Servlets over a custom LoginModule. @ceharris do you have any idea, why a call doesn't come to SOAP webservice over JwtLoginModule in case of ear-deployment? Is there a place for jwt.xml descriptor anywhere in simple-ejb.jar? |
I didn't make any provisions for handling EAR deployments in the extension. To understand why this matters (and how EAR deployments might be supported), you'll need to understand a little more about how this extension plays a role in Wildlfly deployment processing. An extension like this can register one or more deployment processors that get called back by Wildfly each time a deployment occurs. If you look in The When For an EAR deployment, the JWT deployment descriptor, if present at all, I think it would be nested inside of the EAR differently. I haven't used EAR deployments much and I really haven't paid much attention to how things get laid out. In theory though, it should be possible to locate the JWT descriptor inside of the EAR and enable the servlet extension accordingly. The place to experiment with this would be inside of |
@ceharris thank you very much for your help! I debugged the DescriptorDeploymentProcessor and understood how it works. And let me say, that I'm really impressed with a quality of implementation of your project! |
Any better documentation for using the plugin?
Or has the plugin been deprecated?
The text was updated successfully, but these errors were encountered: