Skip to content

APNIC-net/whois-sso-mailupdate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

whois-sso-mailupdate

Overview

This repository provides documentation and example scripts demonstrating how to authenticate using SSO token to perform WHOIS mail update requests.

Prerequisites

  • Python 3.8 or newer
  • APNIC login account
  • A valid Client ID for SSO authentication

Instructions

Authentication Flow

The authentication process consists of two steps:

  1. Fetch refresh token using PKCE with authorization code flow

    The refresh token can be reused to request new access tokens without requiring repeated user login.

    See https://developer.okta.com/docs/guides/refresh-tokens/main/ for more details about the refresh token

    See https://developer.okta.com/docs/guides/refresh-tokens/main/#example-request-for-an-authorization-code-and-refresh-token about how to fetch refresh token using PKCE with authorization code flow

  2. Fetch access token using the returned refresh token

    The refresh token is exchanged for a short-lived access token. The access token will be included in the email when sending WHOIS mail update requests.

Example Usage

Install dependencies

cd examples
python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Fetch refresh token

Note: Make sure the CLIENT_ID has been added to the config.json

python get-refresh-token-with-auth-code-flow.py

Fetch access token

python get-access-token-by-refresh-token.py

Submit whois mail updates

Please see more details on https://www.apnic.net/manage-ip/using-whois/updating-whois/objects/email-updates/

Add the returned access token in the object in the mail and send to auto-dbm@apnic.net

person:         Albert Brooke Crichton
address:        123 Example st.
address:        20097 Exampletown
country:        AU
phone:          +12 34 567890 000
fax-no:         +12 34 567890 010
e-mail:         abc@examplenet.com
nic-hdl:        ABC123-AP
notify:         abc@examplenet.com
mnt-by:         MAINT-EXAMPLENET-AP
source:         APNIC
token:          SSO {token}

About

A guide describing the process of submitting WHOIS mail update requests using SSO tokens

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors