简体   繁体   中英

Jboss RestEasy Oauth2

I want develop REST service with oauth2 security. I selected JBOSS Stack technology JBOSS.8(wildfly)+RestEasy.3.0.5 . In RestEasy guide i founded how to enable oauth module.

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="org.jboss.resteasy.resteasy-yaml-provider" services="import"/>
            <module name="org.jboss.resteasy.resteasy-jsapi" services="import"/>
            <module name="org.jboss.resteasy.resteasy-jackson-provider" services="import"/>
            <module name="org.jboss.resteasy.skeleton-key"/>
            <module name="org.jboss.resteasy.resteasy-multipart-provider" services="import"/>
            <module name="org.jboss.resteasy.resteasy-jaxrs" services="import"/>
    </dependencies>
</deployment>

After start JBOSS write in logs

JBAS018759: Failed to load module: deployment.Astron-Service_Web.war:main Caused by: org.jboss.modules.ModuleNotFoundException: org.jboss.resteasy.skeleton-key:main"}}

How to fix. Or how to easy implement security on rest service?

You have to install the module "org.jboss.resteasy.skeleton-key" in your jboss/wildfly server.

The module can be found in your downloaded resteasy project folder, in a zip named like "resteasy-jboss-modules-wfX-XXXX.Final.zip" for Wildfly. (There is also one for Jboss).

The github documentation of the project advice us to unzip the full folder under the module directory of our server (like wildfly-9.0.1.Final\\modules). Personnally I encountered severals new errors and have then just installed the "org\\jboss\\resteasy\\skeleton-key" module. (maybe due to my wildfly 9.0 installation and modules in v8.0)

Links:

github project : https://github.com/resteasy/Resteasy/tree/master/jaxrs/examples/oauth2-as7-example module installation : http://www.mastertheboss.com/jboss-server/jboss-as-7/how-to-install-a-module-on-jboss-as-7

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM