Skip to content

Grant Type Services

Ken Williamson edited this page Jan 19, 2020 · 2 revisions

Add Grant Type

Method: POST

URL: http://localhost:3000/rs/clientGrantType/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:

{
   "grantType":"code",
   "clientId":101
}

Response:

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

Get Grant Types for a Client

Method: GET

URL: http://localhost:3000/rs/clientGrantType/list/101

101 = clientId

Request headers Example:

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

Response:

[
    {
        "id": 251,
        "grantType": "code",
        "clientId": 101
    },
    {
        "id": 253,
        "grantType": "client_credentials",
        "clientId": 101
    },
    {
        "id": 255,
        "grantType": "password",
        "clientId": 101
    },
    {
        "id": 256,
        "grantType": "implicit",
        "clientId": 101
    }
]

Delete Grant Type

Method: DELETE

URL: http://localhost:3000/rs/clientGrantType/delete/510

tester1 = user
255 = clientId

Request headers Example:

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

Response:

{
    "success": true
}