go-idms-oidc

module
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT

README

Go IDMS OIDC

coverage report

Overview

Tools and libraries for dealing with getting a short lived token, from your long lived token.

External Documentation

Using the CLI Tool idms-oidc-tool

You can download this tool from the releases page above, or instally it by downloading this repository and building locally

Instead of passing your long lived token in as an argument, it is more secure to use the environment variable: IDMSOIDC_LONG_LIVED_TOKEN

$ idms-oidc-tool get-shortlived-token -h
A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:

Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.

Usage:
  idms-oidc-tool [command]

Available Commands:
  describe-longlived-token Get information on your long lived token
  get-shortlived-token     Get a short lived token from OIDC provider
  help                     Help about any command
  version                  Version will output the current build information

Flags:
      --config string   config file (default is $HOME/.idms-oidc-tool.yaml)
  -h, --help            help for idms-oidc-tool
  -t, --toggle          Help message for toggle

Use "idms-oidc-tool [command] --help" for more information about a command.

Using the Go library

You can build the token getter in to your golang app using something similar to the code below

tokenInfo, _, err := authenticate.ShortLivedToken(
  &authenticate.ShortLivedTokenConfig{
    LongLivedToken: "long-lived-token",
    ClientID:       "my-client-id",
    Endpoints:      []string{"my-endpoint"},
  }
)
fmt.Println("Short Lived Token is: " tokenInfo.Token)

Directories

Path Synopsis
Package authenticate allows you to interact with the IDM OIDC service Terminology:
Package authenticate allows you to interact with the IDM OIDC service Terminology:
cmd
idms-oidc-tool/cmd
Package cmd is the...command package
Package cmd is the...command package

Jump to

Keyboard shortcuts

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