This API regenerates a new public-private key pair for an existing application. All existing JWT tokens will be revoked immediately. This action should only be performed in case of a public-private key compromise. This action forces all users to reauthenticate, as all active JWT tokens will be invalidated.
Warning: Do not use this for automatic key rotation. JWTPlus handles key rotation internally.
curl --request GET \
--url http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/pki \
--header 'Authorization: {{root-key}}'
const request = require('request');
const options = {
method: 'GET',
url: 'http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/pki',
headers: {Authorization: '{{root-key}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import requests
url = "http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/pki"
headers = {"Authorization": "{{root-key}}"}
response = requests.get(url, headers=headers)
print(response.json())
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/pki', [
'headers' => [
'Authorization' => '{{root-key}}',
],
]);
echo $response->getBody();
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/pki"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "{{root-key}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "http://{{you-endpoint}}:{{your-port}}/root/{{app-id}}/rotate/pki")
.setHeader("Authorization", "{{root-key}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();