Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 1.75 KB

File metadata and controls

58 lines (38 loc) · 1.75 KB

Authentication

Overview

Manage indexing API tokens.

Available Operations

checkdatasourceauth

Returns all datasource instances that require per-user OAuth authorization for the authenticated user, along with a transient auth token that can be appended to auth URLs to complete OAuth flows.

Clients construct the full OAuth URL by combining the backend base URL, the authUrlRelativePath from each instance, and the transient auth token: <backend>/<authUrlRelativePath>?transient_auth_token=<token>.

Example Usage

package hello.world;

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

        CheckdatasourceauthResponse res = sdk.authentication().checkdatasourceauth()
                .call();

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

Response

CheckdatasourceauthResponse

Errors

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