1. Obtain the link for the Weibo Web Connect web application authorization (guiding the user to the authorization page to log in and consent to authorization, creating a user for the Weibo Web Connect web application), as shown in Figure 1.

2. Open the URL: https://weibo.com/ , and confirm that the Weibo account is not logged in, as shown in Figure 2.

3. Weibo Web Connect web application authorization (guiding the user to the authorization page to log in and consent to authorization, creating a user for the Weibo Web Connect web application): log in and consent to authorization, as shown in Figure 3.

4. Exchange Code for the third-party authorization Access Token, perform the corresponding data operations, create a user for the Weibo Web Connect web application, and obtain the user list for the Weibo Web Connect web application, as shown in Figure 4.

5. Open the URL: https://weibo.com/ , and confirm that the Weibo account (永夜烟) is logged in, as shown in Figure 5.

6. At this point, within the same browser, we need to access the authorization page to log in and consent to authorization using another Weibo account (terryhong123) to create a user for the Weibo Web Connect web application. The creation ultimately fails. Analysis: The first Weibo account (永夜烟) is already in a logged-in state in the same browser, so the login page is automatically skipped to create a user for the Weibo Web Connect web application. However, because a unique index is set on user_id, the creation fails, as shown in Figure 6.
If the user reopens the authorization page to authorize during the valid authorization period (if the user has a Weibo login status at this time, this page will flash by).

7. The current requirement is to be able to repeatedly create multiple users for the Weibo Web Connect web application within the same browser (when creating the second user, it is necessary to enter the authorization page again to log in and consent to authorization). Reviewing the OAuth2.0 documentation, I found that it supports a forced login feature, as shown in Figure 7.
Forced login
The authorization page will read the current user’s Weibo login state by default. If you want the user to log in again, pass the parameter: forcelogin=true when calling the authorize interface. Leaving this parameter blank by default is equivalent to forcelogin=false.

8. Edit \frontend\controllers\WeiboOauth2Controller.php’s public function actionAuthorize(), and pass the parameter: forcelogin=true when calling the authorize interface.
/* 浏览器 302 跳转:引导用户进入授权页面登录同意授权,获取 code */
Yii::$app->response->redirect(Yii::$app->params['weiboAuth']['hostInfo'] . Yii::$app->params['weiboAuth']['baseUrl'] . '/authorize?response_type=code&forcelogin=true&client_id=' . Yii::$app->params['weiboAuth']['weiboConnectWebApp']['appId'] . '&redirect_uri=' . $redirectUri);
9. Now, within the same browser, you can access the authorization page to log in and consent to authorization using another Weibo account (terryhong123), as shown in Figure 8.

10. Exchange Code for the third-party authorization Access Token, perform the corresponding data operations, create a user for the Weibo Web Connect web application, and obtain the user list for the Weibo Web Connect web application, as shown in Figure 9.

11. Open the URL: https://weibo.com/ , and confirm that the Weibo account (永夜烟) has logged out, as shown in Figure 10.

12. Refresh the URL: https://weibo.com/ , and confirm that the Weibo account (terryhong123) is logged in, as shown in Figure 11.

