1# Account Changelog 2 3## cl.account_os_account.1 Deletion of the App Account Authorization Interfaces 4 5**Change Impact** 6 7Apps developed based on earlier versions cannot use the account authorization capability. 8 9**Key API/Component Changes** 10 11Involved APIs: 12 13interface/sdk-js/api/@ohos.account.appAccount.d.ts: 14 15```js 16 enum AccountCapabilityType 17``` 18```js 19 class AccountCapabilityProvider 20``` 21```js 22 class AuthorizationProvider extends AccountCapabilityProvider 23``` 24```js 25 interface AuthorizationProviderInfo 26``` 27```js 28 class AccountCapabilityRequest 29``` 30```js 31 class AccountCapabilityResponse 32``` 33```js 34 class AccountCapabilityScheduler 35``` 36 37interface/sdk-js/api/@ohos.account.appAccount.AuthorizationExtensionAbility.d.ts: 38 39```js 40 export default class AuthorizationExtensionAbility extends ExtensionAbility 41``` 42```js 43 declare interface AuthorizationRequest 44``` 45```js 46 declare interface AuthorizationCallback 47``` 48 49 50After the change: 51 52All the involved interfaces are deleted. 53 54**Adaptation Guide** 55 56The deleted interfaces cannot be used any longer. 57 58 59## cl.account_os_account.2 Change of the Error Codes in addCredential() 60 61**Change Impact** 62 63For the applications developed based on earlier versions, you need to change the error code processing logic. 64 65**Key API/Component Changes** 66 67Involved APIs: 68 69```js 70 class UserIdentityManager { 71 ... 72 addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void; 73 ... 74 } 75``` 76 77Error code list: 78| ID| Error Message | 79| -------- | ------------------- | 80| 12300001 | System service exception. | 81| 12300002 | Invalid credentialInfo, i.e. authType or authSubType. | 82| 12300101 | Token is invalid. | 83| 12300106 | Unsupported authType. | 84| 12300109 | Operation is canceled. | 85| 12300111 | Operation timeout. | 86| 12300115 | The number of credentials reaches the upper limit. | 87 88 89Before the change: 90The error code 12300002 is returned when a session times out. 91 92After the change: 93The error code 12300001 is returned when a session times out. 94 95 96**Adaptation Guide** 97 98Modify the error code processing logic based on the new error codes. 99 100 101## cl.account_os_account.3 Change of getAccountInfo() 102 103Changed the parameters in **getAccountInfo()** from specified type to extensible type (**GetDomainAccountInfoPluginOptions**) to improve the parameter scalability. 104 105**Change Impact** 106 107New parameters must be used. Otherwise, the compilation fails. For details about the adaptation, see the following sample code. 108 109**Key API/Component Changes** 110 111Before change: 112 113```js 114 interface DomainPlugin { 115 ... 116 getAccountInfo(domain: string, accountName: string, callback: AsyncCallback<DomainAccountInfo>): void; 117 ... 118 } 119``` 120 121After change: 122```js 123 interface DomainPlugin { 124 ... 125 getAccountInfo(options: GetDomainAccountInfoPluginOptions, callback: AsyncCallback<DomainAccountInfo>): void; 126 ... 127 } 128``` 129 130**Adaptation Guide** 131 132Change **domain** and **accountName** to **GetDomainAccountInfoPluginOptions**. The sample code is as follows: 133 134```js 135 let plugin: account_osAccount.DomainPlugin = { 136 auth: (domainAccountInfo: account_osAccount.DomainAccountInfo, credential: Uint8Array, 137 callback: account_osAccount.IUserAuthCallback) => {}, 138 authWithPopup: (domainAccountInfo: account_osAccount.DomainAccountInfo, 139 callback: account_osAccount.IUserAuthCallback) => {}, 140 authWithToken: (domainAccountInfo: account_osAccount.DomainAccountInfo, token: Uint8Array, 141 callback: account_osAccount.IUserAuthCallback) => {}, 142 getAccountInfo: (options: account_osAccount.GetDomainAccountInfoPluginOptions, // Change the input parameters. 143 callback: AsyncCallback<account_osAccount.DomainAccountInfo>) => { 144 // mock getting account information 145 // notify result 146 let code: BusinessError = { 147 code: 0, 148 name: "", 149 message: "" 150 }; 151 let accountInfo: account_osAccount.DomainAccountInfo = { 152 domain: options.domain, // Obtain the input parameter. 153 accountName: options.accountName, // Obtain the input parameter. 154 accountId: 'xxxx' 155 }; 156 callback(code, accountInfo); 157 }, 158 getAuthStatusInfo: (domainAccountInfo: account_osAccount.DomainAccountInfo, 159 callback: AsyncCallback<account_osAccount.AuthStatusInfo>) => {}, 160 bindAccount: (domainAccountInfo: account_osAccount.DomainAccountInfo, localId: number, 161 callback: AsyncCallback<void>) => {}, 162 unbindAccount: (domainAccountInfo: account_osAccount.DomainAccountInfo, callback: AsyncCallback<void>) => {}, 163 isAccountTokenValid: (domainAccountInfo: account_osAccount.DomainAccountInfo, token: Uint8Array, 164 callback: AsyncCallback<boolean>) => {}, 165 getAccessToken: (options: account_osAccount.GetDomainAccessTokenOptions, callback: AsyncCallback<Uint8Array>) => {} 166} 167 account_osAccount.DomainAccountManager.registerPlugin(plugin) 168``` 169