Giter Club home page Giter Club logo

identity-rest-dispatcher's Introduction

identity-api-dispatcher

Branch Build Status Travis CI Status
master Build Status Travis CI Status

Aggregates the API implementations from identity-api-user and identity-api-server builds a single webapp inorder to expose the multiple API endpoints in WSO2 Identity Server.

Exposing a new API

  1. Add the dependency of the API implementation into the dependencies section of parent pom file

  2. Include the dependency of the API implementation into the dependencies section of module pom file

  3. Open the beans.xml

    
    components
    │   └── org.wso2.carbon.identity.api.dispatcher
    │       ├── pom.xml
    │       ├── src
    │       │   └── main
    │       │       └── webapp
    │       │           ├── META-INF
    │       │           └── WEB-INF
    │       │               ├── beans.xml
    │       │               └── web.xml
    
  4. Import the API CXF xml file.

       <import resource="classpath:META-INF/cxf/workflow-engine-server-v1-cxf.xml"/>
       <import resource="classpath:META-INF/cxf/claim-management-server-v1-cxf.xml"/>
       <import resource="classpath:META-INF/cxf/challenge-server-v1-cxf.xml"/>
       <import resource="classpath:META-INF/cxf/email-template-server-v1-cxf.xml"/>
    
  5. Add the API implementation from identity-api-user or identity-api-server under the corresponding server tag.

    <jaxrs:server id="server" address="/server/v1">
        <jaxrs:serviceBeans>
            <bean class="org.wso2.carbon.identity.rest.api.server.challenge.v1.ChallengesApi"/>
        </jaxrs:serviceBeans>
        <jaxrs:providers>
            <bean class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
        </jaxrs:providers>
    </jaxrs:server>
    <jaxrs:server id="users" address="/users/v1">
        <jaxrs:serviceBeans>
            <bean class="org.wso2.carbon.identity.rest.api.user.association.v1.UsersApi"/>
            <bean class="org.wso2.carbon.identity.rest.api.user.challenge.v1.UserIdApi"/>
            <bean class="org.wso2.carbon.identity.rest.api.user.challenge.v1.MeApi"/>
        </jaxrs:serviceBeans>
        <jaxrs:providers>
            <bean class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
        </jaxrs:providers>
    </jaxrs:server>
    
  6. Build the component.

     mvn clean install
    

Deploy and test

  1. Once the build completed, copy the api.war in the components/org.wso2.carbon.identity.api.dispatcher/target/ into [IS_HOME]/repository/deployment/server/webapps/ location and restart the server. (If already exploded api folder exists in the location, remove it before restarting)

    ├── components
    │   └── org.wso2.carbon.identity.api.dispatcher
    │       └── target
    │           ├── api.war
    
  2. Access the API

    1. User APIs https://localhost:9443/api/users/v1/<resource>/

      Sample endpoint:

          https://localhost:9443/api/users/v1/me/challenges
      

      Sample Request:

          curl -u admin:admin -v -X GET "https://localhost:9443/api/users/v1/me/challenges" -H "accept: application/json" -k
      
    2. Server APIs https://localhost:9443/api/server/v1/<resource>/

      Sample endpoint:

          https://localhost:9443/api/server/v1/challenges
      

      Sample Request:

          curl -u admin:admin -v -X GET "https://localhost:9443/api/server/v1/challenges" -H "accept: application/json" -k
      

identity-rest-dispatcher's People

Contributors

abilashini avatar anuradhask avatar ashensw avatar ayshsandu avatar darshanasbg avatar emswbandara avatar gdrdabarera avatar inthirakumaaran avatar isurad avatar isurangaperera avatar janakamarasena avatar jkaushalya avatar kanapriya avatar madurangasiriwardena avatar maheshika avatar malithie avatar mefarazath avatar mevan-karu avatar omindu avatar pamodaaw avatar piraveena avatar sarubi avatar senthalan avatar somindatommy avatar thanujalk avatar tharindu-b-hewage avatar vihanga-liyanage avatar wathsara avatar wso2-jenkins-bot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.