Skip to content
Kong Logo | Kong Docs Logo
search
  • We're Hiring!
  • Docs
    • Kong Gateway
    • Kong Konnect
    • Kong Mesh
    • Plugin Hub
    • decK
    • Kubernetes Ingress Controller
    • Insomnia
    • Kuma

    • Docs contribution guidelines
  • Plugin Hub
  • Support
  • Community
  • Kong Academy
Get a Demo Start Free Trial
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Plugin Hub
  • decK
  • Kubernetes Ingress Controller
  • Insomnia
  • Kuma

  • Docs contribution guidelines
  • 3.3.x (latest)
  • 3.2.x
  • 3.1.x
  • 3.0.x
  • 2.8.x
  • 2.7.x
  • 2.6.x
  • Older Enterprise versions (2.1-2.5)
  • Older OSS versions (2.1-2.5)
  • Archive (pre-2.1)

github-edit-pageEdit this page

report-issueReport an issue

enterprise-switcher-iconSwitch to OSS

On this pageOn this page
  • How to Invite and Register an Admin
    • Introduction
    • Prerequisites
  • Step 1
  • Step 2
Kong Gateway
3.1.x
  • Home
  • Kong Gateway
  • Production Deployment
  • Access Control
  • Admins Examples
You are browsing documentation for an outdated version. See the latest documentation here.

Admins Examples

How to Invite and Register an Admin

Introduction

Can be used for automation

Prerequisites

export USERNAME=<username>
export EMAIL=<email>
export WORKSPACE=<workspace>
export HOST=<admin_api_host>
export TOKEN=Kong-Admin-Token:<super_admin_token>

for example:

export USERNAME=drogon
export EMAIL=test@test.com
export WORKSPACE=default
export HOST=127.0.0.1:8001
export ADMIN_TOKEN=Kong-Admin-Token:hunter2

May benefit from HTTPie and jq.

Step 1

Extract and store the token from the registration URL, either by manually creating an environment variable or by echoing and piping with jq:

Manual method example:

  1. Send a request to the registration URL
    http $HOST/$WORKSPACE/admins/$USERNAME?generate_register_url=true $TOKEN
    
  2. Copy the response and export as an environment variable, for example:
    export REGISTER_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NDUwNjc0NjUsImlkIjoiM2IyNzY3MzEtNjIxZC00ZjA3LTk3YTQtZjU1NTg0NmJkZjJjIn0.gujRDi2pX_E7u2zuhYBWD4MoPFKe3axMAq-AUcORg2g
    

Programmatic method (requires jq):

REGISTER_TOKEN=$(http $HOST/$WORKSPACE/admins/$USERNAME?generate_register_url=true $TOKEN | jq .token -r)

Step 2

http $HOST/$WORKSPACE/admins/register token=$REGISTER_TOKEN username=$USERNAME email=$EMAIL password="<new_password>"
Thank you for your feedback.
Was this page useful?
  • Kong
    THE CLOUD CONNECTIVITY COMPANY

    Kong powers reliable digital connections across APIs, hybrid and multi-cloud environments.

    • Company
    • Customers
    • Events
    • Investors
    • Careers Hiring!
    • Partners
    • Press
    • Contact
  • Products
    • Kong Konnect
    • Kong Gateway
    • Kong Mesh
    • Get Started
    • Pricing
  • Resources
    • eBooks
    • Webinars
    • Briefs
    • Blog
    • API Gateway
    • Microservices
  • Open Source
    • Install Kong Gateway
    • Kong Community
    • Kubernetes Ingress
    • Kuma
    • Insomnia
  • Solutions
    • Decentralize
    • Secure & Govern
    • Create a Dev Platform
    • API Gateway
    • Kubernetes
    • Service Mesh
Star
  • Terms•Privacy
© Kong Inc. 2023