目录

Prototype

ProtocolDirectionURL
HTTPS POSTApp server > OAuth2 serverhttps://oauth-login.cloud.huawei.com/oauth2/v2/token

Function

This API is used to obtain an access token.

Scenario

You want to obtain an access token from the OAuth2 server.

Input Parameters (in x-www-form-urlencoded Format)

grant_type=client_credentials&client_id={appId}&client_secret={secretKey}

ParameterValueDescription
grant_typeclient_credentialsAuthentication based on the app certificate.
client_idappIdYour app ID applied in AppGallery Connect.
client_secretsecretKeyYour secret key applied in AppGallery Connect.

Output Parameters

ParameterTypeDescription
access_tokenStringAccess token.
expires_inStringAccess token expiration time.
token_typeStringAccess token type.