- Process - Process Revocation Request
This API revokes access tokens and refresh tokens.
package main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"github.com/authlete/authlete-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.Revocation.Process(ctx, "<id>", components.RevocationRequest{
Parameters: "VFGsNK-5sXiqterdaR7b5QbRX9VTwVCQB87jbr2_xAI&token_type_hint=access_token",
ClientID: authlete.Pointer("26478243745571"),
ClientSecret: authlete.Pointer("gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ"),
})
if err != nil {
log.Fatal(err)
}
if res.RevocationResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
serviceID |
string |
✔️ | A service ID. |
body |
components.RevocationRequest | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.AuthRevocationAPIResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ResultError | 400, 401, 403 | application/json |
| apierrors.ResultError | 500 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |