이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 3. Authentication


3.1. Authorization Tokens

3.1.1. Introduction to Authorization Tokens

An authorization token is a secret value that is used to automatically log in to an OpenShift Enterprise account without entering login information each time. A token is also used to grant another user full or partial access to an account, determined by the scope of the token. The following table describes the different types of scopes available with authorization tokens.
Expand
Table 3.1. Authorization Token Scopes
Scope Description Validity
session Access to all API functions against an account. 1 day
read Read-only access to account resources, but cannot view authorization tokens. 1 month
userinfo Access to login name, unique id, and user capabilities. 1 month
When the client tools are installed and the rhc setup command is initially run to configure the client tools, the setup wizard prompts you to create an authorization token. If you answer YES, the wizard creates a session token in the ~/.openshift directory. With this token, all client tool commands can be run without entering your login credentials each time. When the token expires you are automatically prompted to reenter login information to renew the existing token. See the OpenShift Enterprise Client Tools Installation Guide for more information on installing and configuring the client tools.
If an authorization token was not created when the client tools were installed, run the setup wizard again with the rhc setup command to create one.
If an existing authorization token is no longer required and you do not wish to be prompted for token renewal, run the rhc logout command to delete the token.

3.1.2. Creating Authorization Tokens

Create a new authorization token with the following command:
$ rhc authorization add --scopes Scope --note Namerhc authorization add --scopes Scope --note Namerhc authorization add --scopes Scope --note Namerhc authorization add --scopes Scope --note Name
Copy to Clipboard Toggle word wrap
Specify the scope for the token with the --scopes option, and a name for the token with the --note option.

Example 3.1. Creating an Authorization Token

rhc authorization add --scopes session --note My_Token
Adding authorization ... done

My_token
--------
  Token:      787a57211d42f251204136b05d490038830d9b7057f54f816c2a9fcd0c8333b8
  Scopes:     session
  Created:    4:40 PM
  Expires In: about 1 day
Copy to Clipboard Toggle word wrap
After creating a new authorization token, use the --token token_string global option to run rhc commands as the user associated with the authorization token that was provided.

3.1.3. Viewing Authorization Tokens

View the tokens associated with your account with the following command:
$ rhc authorization list
Copy to Clipboard Toggle word wrap

Example 3.2. Viewing Authorization Tokens

$ rhc authorization list
My_token
--------
  Token:      787a57211d42f251204136b05d490038830d9b7057f54f816c2a9fcd0c8333b8
  Scopes:     session
  Created:    4:40 PM
  Expires In: about 23 hours

RHC/1.8.0 (from laptop.example.com on x86_64-linux)
---------------------------------------------------
  Token:      28f6e375dc7ea57b0dcabb3850d08ee9bc023f7df5dbfa4958afe7ad71d33e37
  Scopes:     session
  Created:    12:58 PM
  Expires In: about 19 hours
Copy to Clipboard Toggle word wrap

3.1.4. Deleting Authorization Tokens

Delete authorization tokens when they are no longer required, or to end access to your account by other users:
Delete Specific Authorization Tokens

Delete one or more tokens with the following command, separating multiple tokens with commas:

$ rhc authorization delete token_1, token_2 rhc authorization delete token_1, token_2
Copy to Clipboard Toggle word wrap

Delete All Authorization Tokens

Delete all tokens associated with your account with the following command:

$ rhc authorization delete-all
Copy to Clipboard Toggle word wrap

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2025 Red Hat