Chapter 1. Creating the Red Hat automation hub API token


Before you can interact with automation hub by uploading or downloading collections, you must create an API token. The automation hub API token authenticates your ansible-galaxy client to the Red Hat automation hub server.

You can create an API token by using Token management in automation hub or API Token Management in private automation hub (PAH).

1.1. Creating the Red Hat automation hub API token

Before you can interact with automation hub by uploading or downloading collections, you need to create an API token. The automation hub API token authenticates your ansible-galaxy client to the Red Hat automation hub server.

You can create an API token using automation hub Token management.

Prerequisites

  • Valid subscription credentials for Red Hat Ansible Automation Platform.

Procedure

  1. Navigate to https://cloud.redhat.com/ansible/automation-hub/token/.
  2. Click Load Token.
  3. Click copy icon to copy the API token to the clipboard.
  4. Paste the API token into a file and store in a secure location.
Important

The API token is a secret token used to protect your content. Store your API token in a secure location.

The API token is now available for configuring automation hub as your default collections server or uploading collections using the ansible-galaxy command line tool.

1.2. Creating the API token in private automation hub

You can create an API token by using API Token Management in private automation hub.

Prerequisites

  • Valid subscription credentials for Red Hat Ansible Automation Platform.

Procedure

  1. Navigate to your PAH.
  2. From the sidebar, navigate to Collections API Token Management.
  3. Click Load Token.
  4. Click the copy icon to copy the API token to the clipboard.
  5. Paste the API token into a file and store in a secure location.
Important

The API token is a secret token used to protect your content. Store your API token in a secure location.

The API token is now available for configuring automation hub as your default collections server or uploading collections using the ansible-galaxy command line tool.

1.3. Keeping your offline token active

Keeping an offline token active is useful when an application needs to perform action on behalf of the user, even when the user is offline. For example, a routine data backup.

Offline tokens expire after 30 days of inactivity. You can keep your offline token from expiring by periodically refreshing your offline token.

Note

Once your offline token expires, you must request a new one.

Run the following command periodically to prevent your token from expiring:

curl https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token -d grant_type=refresh_token -d client_id="cloud-services" -d refresh_token="{{ user_token }}" --fail --silent --show-error --output /dev/null
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.