Skip to content

shashimalcse/asgardeo-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is cli logo

asgardeo-cli is a experimental (non-official) cli app for managing and interacting with Asgardeo integrations.

Features

  • Authenticate as a machine (Client Credentials) or User (Device Flow)
  • Manage applications
    • List applications
    • Create applications (Support Templates)
    • Delete applications
  • Interactive mode
  • Keychain support for storing credentials
  • Logging

Installation

Prerequisites

  • Go 1.16 or higher
  • Make sure $HOME/bin is in your PATH

Steps

  1. Clone the repository:

    git clone https://github.com/shashimalcse/asgardeo-cli.git
    cd asgardeo-cli
    
  2. Build and install the CLI:

    make install
    
  3. Verify the installation:

    asgardeo --version
    

If you encounter any issues, ensure that $HOME/bin is in your PATH by adding the following line to your shell configuration file (~/.zshrc for Zsh or ~/.bash_profile for Bash):

export PATH=$PATH:$HOME/bin

Then, reload your shell configuration:

source ~/.zshrc  # or ~/.bash_profile for Bash

Usage

Authenticating to Your Tenant

Authenticating to your Identity Server/ Asgardeo tenant is required for most functions of the CLI. It can be initiated by running:

asgardeo login

There are two ways to authenticate:

  • As a user - Recommended when invoking on a personal machine or other interactive environment. Facilitated by device authorization flow.

    Authenticating as a user is not supported for Asgardeo tenants.

  • As a machine - Recommended when running on a server or non-interactive environments (ex: CI). Facilitated by client credentials flow.

    • Create a Machine-to-Machine (M2M) application within your Asgardeo organization.

    • Authorize the APIs you want the application to consume.

      Important: Certain functionalities will not work unless the relevant APIs are not authorized to the application.

    • Record the Client ID and Client Secret from the Protocol tab.

    • When prompted, enter the Tenant Domain, Client ID, and Client Secret obtained in the previous step.

Commands:

Apps

  • asgardeo apps list - List your applications
  • asgardeo apps create - Create a new application
  • asgardeo apps delete <app-id> - Delete an application

API Resources

  • asgardeo apis list - List your API resources
  • asgardeo apis create - Create a new API resource
  • asgardeo apis delete <api-id> - Delete an API resource

Screenshot 2024-08-02 at 15 41 42 Screenshot 2024-08-02 at 15 43 22

Contributing

We welcome contributions to this project! Here are some guidelines to follow:

  • Before submitting a pull request, please ensure your code aligns with the Golang Style Guide
  • Update the documentation if you've made changes that affect it.
  • Submit a pull request with a comprehensive description of your changes.

We appreciate your efforts to improve this project!

Support

If you encounter any problems or have any questions, please open an issue on the GitHub repository.

Releases

No releases published

Packages

No packages published