go

module
v0.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2025 License: Apache-2.0

README

Go Asgardeo SDK

Typed Go client SDK for the Asgardeo Management API, enabling easy integration with Asgardeo services.

Requirements

  • Go 1.22 or later

Installation

Use go get to install the SDK:

go get github.com/asgardeo/go

Quick Start

package main

import (
    "context"
    "fmt"
    "log"
    "time"

    "github.com/asgardeo/go/pkg/config"
    "github.com/asgardeo/go/pkg/sdk"
)

func main() {
    // Configure the client with client credentials grant
    cfg := config.DefaultClientConfig().
        WithBaseURL("https://api.asgardeo.io/t/<tenant-domain>").
        WithTimeout(10 * time.Second).
        WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        )

    // Initialize the SDK client
    client, err := sdk.New(cfg)
    if err != nil {
        log.Fatalf("failed to initialize SDK client: %v", err)
    }

    // List applications
    ctx := context.Background()
    resp, err := client.Application.List(ctx, 10, 0)
    if err != nil {
        log.Fatalf("failed to list applications: %v", err)
    }

    fmt.Printf("Total applications: %d\n", *resp.TotalResults)
    for _, app := range *resp.Applications {
        fmt.Printf("- %s (ID: %s)\n", *app.Name, *app.Id)
    }
}

Examples

A runnable example is available in the examples/application directory:

go run examples/application/main.go

Services

  • Applications

Contributing

Contributions, issues, and feature requests are welcome! Feel free to open a pull request or an issue to get started.

Directories

Path Synopsis
examples
api_resource command
application command
authenticator command
claim command
oidc_scope command
user command
pkg
api_resource/internal
Package internal provides primitives to interact with the openapi HTTP API.
Package internal provides primitives to interact with the openapi HTTP API.
application/internal
Package internal provides primitives to interact with the openapi HTTP API.
Package internal provides primitives to interact with the openapi HTTP API.
authenticator/internal
Package internal provides primitives to interact with the openapi HTTP API.
Package internal provides primitives to interact with the openapi HTTP API.
claim/internal
Package internal provides primitives to interact with the openapi HTTP API.
Package internal provides primitives to interact with the openapi HTTP API.
identity_provider/internal
Package internal provides primitives to interact with the openapi HTTP API.
Package internal provides primitives to interact with the openapi HTTP API.
oidc_scope/internal
Package internal provides primitives to interact with the openapi HTTP API.
Package internal provides primitives to interact with the openapi HTTP API.
sdk

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL