# Pushing Notifications of Authorization Changes

When the Official Account or Mini Program grants authorization to the third-party platform, cancels authorization, or updates the authorization, the Weixin server uses the POST method to push the relevant notification to the third-party platform's authorization event receipt URL entered by the third-party platform during creation.

After receiving the POST request, the third-party platform just needs to return the string success. To enhance security, the xml in postdata is encrypted with the encryption/decryption key entered during the service application. For details, see the Technical Solution for Encryption/Decryption. Received push messages must be decrypted (for details, see Message Encryption/Decryption Access Guide).

# Fields

Parameter Type Field Description
AppId string Third-party platform's AppID
CreateTime number Timestamp
InfoType string Notification type. See InfoType description for details.
AuthorizerAppid string The AppID of the Official Account or Mini Program
AuthorizationCode string Authorization code, used to get authorization information.
AuthorizationCodeExpiredTime nubmer Expiration time of authorization code (in sec)
PreAuthCode string Pre-authorization code

# InfoType description

type Description
unauthorized Cancels authorization
updateauthorized Updates authorization
authorized Authorized successfully

Example of decrypted push content:

# Notification of successful authorization
<xml>
  <AppId>The third-party platform's appid</AppId>
  <CreateTime>1413192760</CreateTime>
  <InfoType>authorized</InfoType>
  <AuthorizerAppid>The Official Account's appid</AuthorizerAppid>
  <AuthorizationCode>Authorization code</AuthorizationCode>
  <AuthorizationCodeExpiredTime>Expiration time</AuthorizationCodeExpiredTime>
  <PreAuthCode>Pre-authorization code</PreAuthCode>
<xml>
# Notification of canceling authorization
<xml>
  <AppId>The third-party platform's appid</AppId>
  <CreateTime>1413192760</CreateTime>
  <InfoType>unauthorized</InfoType>
  <AuthorizerAppid>The Official Account's appid</AuthorizerAppid>
</xml>
# Notification of updating authorization
<xml>
  <AppId>The third-party platform's appid</AppId>
  <CreateTime>1413192760</CreateTime>
  <InfoType>updateauthorized</InfoType>
  <AuthorizerAppid>The Official Account's appid</AuthorizerAppid>
  <AuthorizationCode>Authorization code</AuthorizationCode>
  <AuthorizationCodeExpiredTime>Expiration time</AuthorizationCodeExpiredTime>
  <PreAuthCode>Pre-authorization code</PreAuthCode>
<xml>