Branch | Build Status | Travis CI Status |
---|---|---|
master |
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.
-
Refer identity-api-user repository for the implementation of user APIs
-
Refer identity-api-server repository for the implementation of server APIs
-
Add the dependency of the API implementation into the dependencies section of parent pom file
-
Include the dependency of the API implementation into the dependencies section of module pom file
-
Open the beans.xml
components │ └── org.wso2.carbon.identity.api.dispatcher │ ├── pom.xml │ ├── src │ │ └── main │ │ └── webapp │ │ ├── META-INF │ │ └── WEB-INF │ │ ├── beans.xml │ │ └── web.xml
-
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"/>
-
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>
-
Build the component.
mvn clean install
-
Once the build completed, copy the
api.war
in thecomponents/org.wso2.carbon.identity.api.dispatcher/target/
into[IS_HOME]/repository/deployment/server/webapps/
location and restart the server. (If already explodedapi
folder exists in the location, remove it before restarting)├── components │ └── org.wso2.carbon.identity.api.dispatcher │ └── target │ ├── api.war
-
Access the API
-
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
-
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
-