Obtaining Business Owner Details from Wso2 APPM 2.1.0

At the time when I'm writing this APPM 2.1.0 is yet to release and I will use APPM 2.1.0 Alpha pack to obtain business owner details.

How to register the API client application

 

We can use post man client to send below payload with the headers to register API client application.

Headers
Authorization : Basic YWRtaW46YWRtaW4= ('YWRtaW46YWRtaW4=' is base64 encoded value of admin:admin)
Content-Type  :application/json

Payload
{ "callbackUrl":"www.google.lk",clientName":"app_11_04_0013","tokenScope":
"Production","owner":"admin","grantType":"password refresh_token","saasApp":true}
















The sample response is as below
{"clientId":"9Xb0a5VIqM3lh40Sz9nKNDTHK5ga","clientName":"app_11_04_0013",
"CallBackURL":"www.google.lk","clientSecret":"JxqHRTejpwQ3JomezwxAZZBGC3Ia"}

 

 Obtaining the access token

 

We need to get the base64encoded value of clientId:clientSecret to generate the curl command to obtain the access token. We can encode it from here.
The following curl command can be used to request the access token.
curl -X POST -H "Authorization: Basic OVhiMGE1VklxTTNsaDQwU3o5bktORFRISzVnYTpKeHFIUlRlanB3UTNKb21lend4QVpaQkdDM0lh" -H "Host: 127.0.0.1:9763" -H "Content-Type:application/x-www-form-urlencoded" http://localhost:9763/oauth2/token -d 'username=admin&password=admin&grant_type=password&scope=appm:read'

  The response will be as below.

 {"scope":"appm:read","token_type":"Bearer","expires_in":3600,"refresh_token":"d3b3fd808971155175081da473748b6d","access_token":"c7f5b01843b28ae7090a22f9db198c71"}


 Obtaining business owner details


Defining business owners can be done by using admin-dashboard which can be accessed using https://localhost:9443/admin-dashboard. You can find more details on business owners functionality form here

 
The request to obtain business user request

curl -X GET -H "Authorization: Bearer c7f5b01843b28ae7090a22f9db198c71" "http://localhost:9763/api/appm/publisher/v1.1/administration/businessowner/1" -i



 The response obtained
HTTP/1.1 200 OK Date: Thu, 02 Jun 2016 05:45:33 GMT Content-Type: application/json Transfer-Encoding: chunked Server: WSO2 Carbon Server {"site":"","email":"hasanthi@gmail.com","description":"","name":"hasanthi","properties":[],"id":1}

Comments

Popular posts from this blog

Applying CORS Filter to wso2 Identity Server

JWKS endpoint of wso2 IS

DCR VS DCRM with WSO2 Identity server