import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.client.management.updateSecret({
serviceId: "<id>",
clientIdentifier: "<value>",
clientSecretUpdateRequest: {
clientSecret: "my_updated_client_secret",
},
});
console.log(result);
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.client_management.update_secret(service_id: '<id>', client_identifier: '<value>', client_secret_update_request: Models::Components::ClientSecretUpdateRequest.new(
client_secret: 'my_updated_client_secret'
))
unless res.client_secret_update_response.nil?
# handle response
endpackage 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.Client.Management.UpdateSecret(ctx, "<id>", "<value>", components.ClientSecretUpdateRequest{
ClientSecret: "my_updated_client_secret",
})
if err != nil {
log.Fatal(err)
}
if res.ClientSecretUpdateResponse != nil {
// handle response
}
}curl --request POST \
--url https://us.authlete.com/api/{serviceId}/client/secret/update/{clientIdentifier} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientSecret": "<string>"
}
'{
"resultCode": "A149001",
"resultMessage": "[A149001] Successfully updated the client secret of the client (ID = 26478243745571).",
"newClientSecret": "my_updated_client_secret",
"oldClientSecret": "6Rg_WDO23F0HSZe8GzE5_ZxRHD2pCA02M7T87s0MNOmnf8hg9eYScgeH6P_tb42yiaRuptJmMY12jwWuoy2KeA"
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Update Client Secret
Update the client secret of a client.
If you want to have the Authlete server generate a new value of the client secret, use /api/client/secret/refresh
API.
import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.client.management.updateSecret({
serviceId: "<id>",
clientIdentifier: "<value>",
clientSecretUpdateRequest: {
clientSecret: "my_updated_client_secret",
},
});
console.log(result);
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.client_management.update_secret(service_id: '<id>', client_identifier: '<value>', client_secret_update_request: Models::Components::ClientSecretUpdateRequest.new(
client_secret: 'my_updated_client_secret'
))
unless res.client_secret_update_response.nil?
# handle response
endpackage 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.Client.Management.UpdateSecret(ctx, "<id>", "<value>", components.ClientSecretUpdateRequest{
ClientSecret: "my_updated_client_secret",
})
if err != nil {
log.Fatal(err)
}
if res.ClientSecretUpdateResponse != nil {
// handle response
}
}curl --request POST \
--url https://us.authlete.com/api/{serviceId}/client/secret/update/{clientIdentifier} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientSecret": "<string>"
}
'{
"resultCode": "A149001",
"resultMessage": "[A149001] Successfully updated the client secret of the client (ID = 26478243745571).",
"newClientSecret": "my_updated_client_secret",
"oldClientSecret": "6Rg_WDO23F0HSZe8GzE5_ZxRHD2pCA02M7T87s0MNOmnf8hg9eYScgeH6P_tb42yiaRuptJmMY12jwWuoy2KeA"
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Authorizations
Authenticate every request with a Service Access Token or Organization Token.
Set the token value in the Authorization: Bearer <token> header.
Service Access Token: Scoped to a single service. Use when automating service-level configuration or runtime flows.
Organization Token: Scoped to the organization; inherits permissions across services. Use for org-wide automation or when managing multiple services programmatically.
Both token types are issued by the Authlete console or provisioning APIs.
Path Parameters
A service ID.
The client ID or the client ID alias of a client.
Body
The new value of the client secret. Valid characters for a client secret are A-Z, a-z, 0-9,
-, and _. The maximum length of a client secret is 86.