Tìm thấy giải pháp của tôi-tự về vấn đề phạm vi, có thể nó sẽ có ích cho một ai đó - được đánh dấu bằng ** trong config:
'modules' => [
'oauth2' => [
'class' => 'filsh\yii2\oauth2server\Module',
'tokenParamName' => 'accessToken',
'tokenAccessLifetime' => 3600 * 24,
'storageMap' => [
'client_credentials' => 'app\models\User',
'user_credentials' => 'app\models\User',
**'scope' => 'app\models\User',**
],
'grantTypes' => [
'client_credentials' => [
'class' => '\OAuth2\GrantType\ClientCredentials',
'allow_public_clients' => false,
'always_issue_new_refresh_token' => true
],
'user_credentials' => [
'class' => 'OAuth2\GrantType\UserCredentials',
],
'refresh_token' => [
'class' => 'OAuth2\GrantType\RefreshToken',
'always_issue_new_refresh_token' => true
]
]
]
],
Nguồn
2016-09-02 10:24:00
Link chỉ câu trả lời không được hoan nghênh trên StackOverflow. Vui lòng thêm phần cần thiết để trả lời. – arogachev