Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 2.43 KB

File metadata and controls

67 lines (47 loc) · 2.43 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 main

import(
	"context"
	"os"
	apiclientgo "github.com/gleanwork/api-client-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := apiclientgo.New(
        apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
    )

    res, err := s.Authentication.Checkdatasourceauth(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if res.CheckDatasourceAuthResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
opts []operations.Option The options for this request.

Response

*operations.CheckdatasourceauthResponse, error

Errors

Error Type Status Code Content Type
apierrors.APIError 4XX, 5XX */*