interactive

package
v0.0.0-...-9c4b67b Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

README

Interactive Mode

The interactive mode can be used to handle application configurations in an interactive manner. This can be used to add, list, export, and import applications in the target environment.

Note: This mode does not provide support for bulk resource export or import.

Run the tool in the interactive mode

See the topics given below to run the tool in interactive mode.

Tool initialization
  1. Set up the tool and WSO2 IS following the steps in the [How to run the tool ](../../../README.md##How to run the tool ) section.
  2. Run the following command to initialize the tool by providing details of WSO2 IS and the client ID/secret of the app you created.
iamctl init

Provide the details as prompted by the tool.

:~$ iamctl init
  ___      _      __  __            ____   _____   _     
 |_ _|    / \    |  \/  |          / ___| |_   _| | |    
  | |    / _ \   | |\/| |  _____  | |       | |   | |    
  | |   / ___ \  | |  | | |_____| | |___    | |   | |___ 
 |___| /_/   \_\ |_|  |_|          \____|   |_|   |_____|
      
? Enter IAM URL [<schema>://<host>]: https://localhost:9443                                                   
? Enter clientID: *******
? Enter clientSecret: *******
? Enter Tenant domain: carbon.super

Run the following command to provide admin user credentials.

iamctl serverConfiguration [flags]

Flags:

  -h, --help              help for serverConfiguration
  -p, --password string   enter your password
  -s, --server string     set server domain
  -u, --username string   enter your username

example:-

iamctl serverConfiguration -h                                           //help for serverConfiguration
iamctl serverConfiguration -s=https://localhost:9443 -u=admin -p=*****  //to complete the authorization

Set admin user credentials by entering inputs in an interactive way.

iamctl serverConfiguration

example:-

~$ iamctl serverConfiguration 
? Enter IAM URL [<schema>://<host>]: https://localhost:9443
? Enter Username: admin
? Enter Password: *****

Add application

iamctl application [commands]
iamctl application     add      [flags]

Flags:

  -c, --callbackURl string    callbackURL  of SP - **for oauth application
  -d, --description string    description of SP - **for basic application
  -h, --help                  help for add
  -n, --name string           name of service provider - **compulsory
  -p, --password string       Password for Identity Server
  -s, --serverDomain string   server Domain
  -t, --type string           Enter application type (default "oauth")
  -u, --userName string       Username for Identity Server

Users have the freedom to set flags and values according to their choices.

This -t, --type string Enter application type (default "oauth") flag is not mandatory. If the user wants to create a basic application, it is necessary to declare -t=basic. Otherwise, the OAuth application will be created as the default type.

example:-

//create an oauth application
iamctl application add  -n=TestApplication 
iamctl application add -t=oauth -n=TestApplication
iamctl application add -t=oauth -n=TestApplication -d=description
iamctl application add -t=oauth -n=TestApplication -c=https://localhost:8010/oauth
iamctl application add -t=oauth -n=TestApplication -c=https://localhost:8010/oauth -d=description

//create an basic application
iamctl application add -t=basic -n=TestApplication
iamctl application add -t=basic -n=TestApplication -d=description

You can set the server domain and create an application at the same time.

example:-

//create an oauth application
iamctl application add -s=https://localhost:9443 -u=admin -p=***** -n=TestApplication 
iamctl application add -s=https://localhost:9443 -u=admin -p=***** -t=oauth -n=TestApplication
iamctl application add -s=https://localhost:9443 -u=admin -p=***** -t=oauth -n=TestApplication -d=description
iamctl application add -s=https://localhost:9443 -u=admin -p=***** -t=oauth -n=TestApplication -c=https://localhost:8010/oauth
iamctl application add -s=https://localhost:9443 -u=admin -p=***** -t=oauth -n=TestApplication -c=https://localhost:8010/oauth -d=description

//create an basic application
iamctl application add -s=https://localhost:9443 -u=admin -p=***** -t=basic -n=TestApplication
iamctl application add -s=https://localhost:9443 -u=admin -p=***** -t=basic -n=TestApplication -d=description

Get a list of applications

iamctl application     list     [flags]

Flags:

  -h, --help              help for list
  -p, --password string   Password for Identity Server
  -s, --server string     server
  -u, --userName string   User name for Identity Server

example:-

//get list of applications
iamctl application list 

You can set the server domain and get the list of applications at the same time. example:-

//get list of applications
iamctl application list -s=https://localhost:9443 -u=admin -p=*****
Create service providers by entering inputs in an interactive way

Add application and get list of applications

iamctl application

It gives the following output after entering the server domain.

$ iamctl application                                                      
? Select the option to move on:  [Use arrows to move, type to filter]
> Add application
  Get List
  Exit

To add application you should select add application from selections. example:-

~$ iamctl application                                                       
? Select the option to move on: Add application
? Select the configuration type:  [Use arrows to move, type to filter]
> Basic application
  oauth

To view list of applications you should select Get List from selections.

example:-

$ iamctl application                                                        
? Select the option to move on: Get List

Create a client application by getting framework specific artifacts

iamctl createclientapp

It gives the following output example:-

~$ iamctl createclientapp                                                       
? Enter your web app technology (Eg: spring-boot) : spring-boot
? Enter the package name of the project (Eg: com.example.demo) : com.example.demo
? Enter your OAuth application Name (Eg:TestApp) : Testapp

Flags:

  -h, --help                  Help for list
  -t, --technology   string   Technology or Framework of the web app. Eg: spring-boot
  -k, --package      string   Package name of the project where artifacts are going to be placed. Eg: com.example.demo
  -a, --application  string   Name of the application Eg:TestApp

Now you have successfully installed the artifacts and secured with OIDC using WSO2 IS..

Documentation

Index

Constants

View Source
const SCOPE string = "" /* 259-byte string literal not displayed */

Variables

View Source
var AUTHURL string
View Source
var ArtifactServiceUrl string
View Source
var CLIENTID string
View Source
var CLIENTSECRET string
View Source
var IAMURL string
View Source
var SERVER string
View Source
var TENANTDOMAIN string

Functions

This section is empty.

Types

type Application

type Application struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Self        string `json:"self"`
}

type ArtifactInfo

type ArtifactInfo struct {
	Name string `json:"name"`
}

type Data

type Data struct {
	Data     string   `json:"data"`
	Metadata Metadata `json:"metadata"`
}

type Export

type Export struct {
	ApplicationID string `json:"applicationId"`
}

type HttpResponse

type HttpResponse struct {
	Error        bool   `json:"error"`
	ErrorMessage string `json:"errorMessage"`
	ResponseData ResponseData
}

Response from artifact-service

type List

type List struct {
	TotalResults int           `json:"totalResults"`
	StartIndex   int           `json:"startIndex"`
	Count        int           `json:"count"`
	Applications []Application `json:"applications"`
	Links        []string      `json:"links"`
}

type Metadata

type Metadata struct {
	Path      string `json:"path"`
	Operation string `json:"operation"`
}

type Parts

type Parts struct {
	GrantTypes   []string `json:"grantTypes"`
	CallbackURLs []string `json:"callbackURLs"`
	PublicClient bool     `json:"publicClient"`
}

type Parts1

type Parts1 struct {
	Oidc Parts `json:"oidc"`
}

type ResponseData

type ResponseData struct {
	ArtifactInfo ArtifactInfo
	Data         []Data
}

type ServerInfo

type ServerInfo struct {
	Server      string `json:"server"`
	PackageName string `json:"packageName"`
	Application string `json:"application"`
}

type ServiceProvider

type ServiceProvider struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type ServiceProviderOAuth

type ServiceProviderOAuth struct {
	Name                         string `json:"name"`
	Description                  string `json:"description"`
	InboundProtocolConfiguration Parts1 `json:"inboundProtocolConfiguration"`
}

type ServiceProviderXml

type ServiceProviderXml struct {
	XMLName                     xml.Name `xml:"ServiceProvider"`
	Text                        string   `xml:",chardata"`
	ApplicationName             string   `xml:"ApplicationName"`
	Description                 string   `xml:"Description"`
	JwksUri                     string   `xml:"JwksUri"`
	InboundAuthenticationConfig struct {
		Text                                string `xml:",chardata"`
		InboundAuthenticationRequestConfigs struct {
			Text                               string `xml:",chardata"`
			InboundAuthenticationRequestConfig []struct {
				Text                 string `xml:",chardata"`
				InboundAuthKey       string `xml:"InboundAuthKey"`
				InboundAuthType      string `xml:"InboundAuthType"`
				InboundConfigType    string `xml:"InboundConfigType"`
				Properties           string `xml:"Properties"`
				InboundConfiguration string `xml:"inboundConfiguration"`
			} `xml:"InboundAuthenticationRequestConfig"`
		} `xml:"InboundAuthenticationRequestConfigs"`
	} `xml:"InboundAuthenticationConfig"`
	LocalAndOutBoundAuthenticationConfig struct {
		Text                                  string `xml:",chardata"`
		AuthenticationSteps                   string `xml:"AuthenticationSteps"`
		AuthenticationType                    string `xml:"AuthenticationType"`
		AlwaysSendBackAuthenticatedListOfIdPs string `xml:"alwaysSendBackAuthenticatedListOfIdPs"`
		UseTenantDomainInUsername             string `xml:"UseTenantDomainInUsername"`
		UseUserstoreDomainInRoles             string `xml:"UseUserstoreDomainInRoles"`
		UseUserstoreDomainInUsername          string `xml:"UseUserstoreDomainInUsername"`
		SkipConsent                           string `xml:"SkipConsent"`
		SkipLogoutConsent                     string `xml:"skipLogoutConsent"`
		EnableAuthorization                   string `xml:"EnableAuthorization"`
	} `xml:"LocalAndOutBoundAuthenticationConfig"`
	RequestPathAuthenticatorConfigs string `xml:"RequestPathAuthenticatorConfigs"`
	InboundProvisioningConfig       struct {
		Text                  string `xml:",chardata"`
		ProvisioningUserStore string `xml:"ProvisioningUserStore"`
		IsProvisioningEnabled string `xml:"IsProvisioningEnabled"`
		IsDumbModeEnabled     string `xml:"IsDumbModeEnabled"`
	} `xml:"InboundProvisioningConfig"`
	OutboundProvisioningConfig struct {
		Text                          string `xml:",chardata"`
		ProvisioningIdentityProviders string `xml:"ProvisioningIdentityProviders"`
	} `xml:"OutboundProvisioningConfig"`
	ClaimConfig struct {
		Text                           string `xml:",chardata"`
		RoleClaimURI                   string `xml:"RoleClaimURI"`
		LocalClaimDialect              string `xml:"LocalClaimDialect"`
		IdpClaim                       string `xml:"IdpClaim"`
		ClaimMappings                  string `xml:"ClaimMappings"`
		AlwaysSendMappedLocalSubjectId string `xml:"AlwaysSendMappedLocalSubjectId"`
		SPClaimDialects                string `xml:"SPClaimDialects"`
	} `xml:"ClaimConfig"`
	PermissionAndRoleConfig struct {
		Text         string `xml:",chardata"`
		Permissions  string `xml:"Permissions"`
		RoleMappings string `xml:"RoleMappings"`
		IdpRoles     string `xml:"IdpRoles"`
	} `xml:"PermissionAndRoleConfig"`
	IsSaaSApp      string `xml:"IsSaaSApp"`
	ImageUrl       string `xml:"ImageUrl"`
	AccessUrl      string `xml:"AccessUrl"`
	IsDiscoverable string `xml:"IsDiscoverable"`
}

Jump to

Keyboard shortcuts

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