Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 1.68 KB

File metadata and controls

49 lines (32 loc) · 1.68 KB

Indexing.Authentication

Overview

Available Operations

rotateToken

Rotates the secret value inside the Indexing API token and returns the new raw secret. All other properties of the token are unchanged. In order to rotate the secret value, include the token as the bearer token in the /rotatetoken request. Please refer to Token rotation documentation for more information.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1RotatetokenResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        PostApiIndexV1RotatetokenResponse res = sdk.indexing().authentication().rotateToken()
                .call();

        if (res.rotateTokenResponse().isPresent()) {
            // handle response
        }
    }
}

Response

PostApiIndexV1RotatetokenResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*