@@ -40,14 +40,16 @@ $users = $management->users()->paginate();
40
40
41
41
## 使用认证模块
42
42
43
- 初始化 ` AuthenticationClient ` 需要 ` userPoolId ` (用户池 ID):
43
+ 初始化 ` AuthenticationClient ` 需要 ` appId ` (应用 ID):
44
44
45
- > 你可以在此[ 了解如何获取 UserPoolId ] ( https://docs.authing.cn/v2/ guides/faqs/get-userpool -id-and-secret.html ) .
45
+ > 你可以在此[ 了解如何获取 AppId ] ( / guides/faqs/get-app -id-and-secret.md ) .
46
46
47
47
``` php
48
48
use Authing\Auth\AuthenticationClient;
49
49
50
- $authentication = new AuthenticationClient("AUTHING_USERPOOL_ID");
50
+ $authentication = new AuthenticationClient(function ($ops) {
51
+ $ops->appId = "---";
52
+ });
51
53
```
52
54
53
55
接下来可以进行注册登录等操作:
@@ -56,7 +58,9 @@ $authentication = new AuthenticationClient("AUTHING_USERPOOL_ID");
56
58
use Authing\Auth\AuthenticationClient;
57
59
use Authing\Types\LoginByEmailInput;
58
60
59
- $authentication = new AuthenticationClient("AUTHING_USERPOOL_ID");
61
+ $authentication = new AuthenticationClient(function ($ops) {
62
+ $ops->appId = "---";
63
+ });
60
64
$user = $authentication->loginByEmail(new LoginByEmailInput("test@example.com", "123456"));
61
65
```
62
66
@@ -67,7 +71,9 @@ use Authing\Auth\AuthenticationClient;
67
71
use Authing\Types\LoginByEmailInput;
68
72
use Authing\Types\UpdateUserInput;
69
73
70
- $authentication = new AuthenticationClient("AUTHING_USERPOOL_ID");
74
+ $authentication = new AuthenticationClient(function ($ops) {
75
+ $ops->appId = "---";
76
+ });
71
77
$authentication->loginByEmail(new LoginByEmailInput("test@example.com", "123456"));
72
78
73
79
$user = $authentication->updateProfile((new UpdateUserInput())->withNickname("nickname"));
@@ -78,7 +84,9 @@ $user = $authentication->updateProfile((new UpdateUserInput())->withNickname("ni
78
84
``` php
79
85
use Authing\Auth\AuthenticationClient;
80
86
81
- $authentication = new AuthenticationClient("AUTHING_USERPOOL_ID");
87
+ $authentication = new AuthenticationClient(function ($ops) {
88
+ $ops->appId = "---";
89
+ });
82
90
$authentication->setAccessToken("ACCESS_TOKEN");
83
91
```
84
92
@@ -88,7 +96,9 @@ $authentication->setAccessToken("ACCESS_TOKEN");
88
96
use Authing\Auth\AuthenticationClient;
89
97
use Authing\Types\UpdateUserInput;
90
98
91
- $authentication = new AuthenticationClient("AUTHING_USERPOOL_ID");
99
+ $authentication = new AuthenticationClient(function ($ops) {
100
+ $ops->appId = "---";
101
+ });
92
102
$authentication->setAccessToken("ACCESS_TOKEN");
93
103
94
104
$user = $authentication->updateProfile((new UpdateUserInput())->withNickname("nickname"));
0 commit comments