Linux command
oauth2c 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Get access token
oauth2c [client_id] [client_secret] --token-url [url]
Authorization code flow
oauth2c --auth-url [url] --token-url [url] --redirect-uri [uri]
Client credentials flow
oauth2c [client_id] [client_secret] --token-url [url] --grant-type client_credentials
With scopes
oauth2c [client_id] [client_secret] --token-url [url] --scope "[scope1 scope2]"
说明
oauth2c is an OAuth2 CLI client that obtains access tokens using various OAuth2 grant types. It supports authorization code, client credentials, device code, and other standard flows. The tool is useful for testing OAuth2-protected APIs, debugging authentication flows, and scripting token acquisition. It opens a browser for authorization code flows and displays the obtained token on stdout.
参数
- --auth-url _URL_
- Authorization endpoint.
- --token-url _URL_
- Token endpoint.
- --redirect-uri _URI_
- Redirect URI.
- --grant-type _TYPE_
- OAuth2 grant type.
- --scope _SCOPES_
- Requested scopes.
- --help
- Display help information.
FAQ
What is the oauth2c command used for?
oauth2c is an OAuth2 CLI client that obtains access tokens using various OAuth2 grant types. It supports authorization code, client credentials, device code, and other standard flows. The tool is useful for testing OAuth2-protected APIs, debugging authentication flows, and scripting token acquisition. It opens a browser for authorization code flows and displays the obtained token on stdout.
How do I run a basic oauth2c example?
Run `oauth2c [client_id] [client_secret] --token-url [url]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --auth-url _URL_ do in oauth2c?
Authorization endpoint.