Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 1.55 KB

File metadata and controls

54 lines (35 loc) · 1.55 KB

Client.Authentication

Overview

Available Operations

createToken

Creates an authentication token for the authenticated user. These are specifically intended to be used with the Web SDK.

Note: The tokens generated from this endpoint are not valid tokens for use with the Client API (e.g. /rest/api/v1/*).

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.CreateauthtokenResponse;
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();

        CreateauthtokenResponse res = sdk.client().authentication().createToken()
                .call();

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

Response

CreateauthtokenResponse

Errors

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