Client Services - Ulbora/GoAuth2 GitHub Wiki

Add Client

Method: POST

URL: http://localhost:3000/rs/client/add

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2
clientId = 10
userId = tester (when using Auth code, Implicit, or Password tokens)

Request Body Example:

{
   "name":"someNewUser",
   "webSite":"www.someNewUser.com",
   "email":"[email protected]",
   "enabled":true,
   "redirectUrls":[
      {
         "uri":"http://www.google.com",
         "clientId":null
      },
      {
         "uri":"http://www.ulboralabs.com",
         "clientId":null
      }
   ]
}

Response:

{
   "success": true,
   "id": 34
}

Update Client

Method: PUT

URL: http://localhost:3000/rs/client/update

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2
clientId = 10
userId = tester (when using Auth code, Implicit, or Password tokens)

Request Body Example:

{
  "clientId": 510,
  "name": "ulbora",
  "webSite": "www.ulboralabs.com",
  "email": "[email protected]",
  "enabled": false
}

Response:

{
   "success": true
}

Get Client

Method: GET

URL: http://localhost:3000/rs/client/get/101

101 = clientId

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10
userId = tester (when using Auth code, Implicit, or Password tokens)


Response:

{
    "clientId": 101,
    "secret": "jhcy2YGrvgDsm4VRVtUESiI96K65gQeXcA2TQCJYZW0J1cYLio",
    "name": "testAccount",
    "webSite": "http://www.goauth2.com",
    "email": "[email protected]",
    "enabled": true,
    "paid": false,
    "redirectUrls": [
        {
            "id": 829,
            "uri": "http://localhost:8091/tokenHandler",
            "clientId": 10
        },
        {
            "id": 830,
            "uri": "http://localhost:8090/admin/token",
            "clientId": 10
        },
        {
            "id": 831,
            "uri": "http://localhost:8092/tokenImplicitHandler",
            "clientId": 10
        },
        {
            "id": 833,
            "uri": "http://www.google.com",
            "clientId": 10
        }
    ]
}

Get All Clients

Method: GET

URL: http://localhost:3000/rs/client/list

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10
userId = tester (when using Auth code, Implicit, or Password tokens)

Response:

[
    {
        "clientId": 10,
        "secret": "",
        "name": "admin",
        "webSite": "http://www.goauth2.com",
        "email": "[email protected]",
        "enabled": true,
        "paid": false,
        "redirectUrls": null
    }
]

Search Clients by name

Method: POST

URL: http://localhost:3000/rs/client/search

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2
clientId = 10
userId = tester (when using Auth code, Implicit, or Password tokens)

Request Body Example:

{
  "name": "admin"  
}

Response:

[
    {
        "clientId": 10,
        "secret": "",
        "name": "admin",
        "webSite": "http://www.goauth2.com",
        "email": "[email protected]",
        "enabled": true,
        "paid": false,
        "redirectUrls": null
    }
]

Get Client Admin (Used when a client needs to get own info)

Method: GET

URL: http://localhost:3000/rs/client/admin/get


Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 101



Response:

{
    "clientId": 101,
    "secret": "jhcy2YGrvgDsm4VRVtUESiI96K65gQeXcA2TQCJYZW0J1cYLio",
    "name": "testAccount",
    "webSite": "http://www.goauth2.com",
    "email": "[email protected]",
    "enabled": true,
    "paid": false,
    "redirectUrls": [
        {
            "id": 829,
            "uri": "http://localhost:8091/tokenHandler",
            "clientId": 10
        },
        {
            "id": 830,
            "uri": "http://localhost:8090/admin/token",
            "clientId": 10
        },
        {
            "id": 831,
            "uri": "http://localhost:8092/tokenImplicitHandler",
            "clientId": 10
        },
        {
            "id": 833,
            "uri": "http://www.google.com",
            "clientId": 10
        }
    ]
}