mirror of
https://github.com/elyby/accounts.git
synced 2025-02-03 17:30:02 +05:30
Обновлены роуты для oAuth2 запросов по последней спеке
This commit is contained in:
parent
31679b84cb
commit
c25bfeb8bc
@ -3,4 +3,6 @@ return [
|
|||||||
'/accounts/change-email/initialize' => 'accounts/change-email-initialize',
|
'/accounts/change-email/initialize' => 'accounts/change-email-initialize',
|
||||||
'/accounts/change-email/submit-new-email' => 'accounts/change-email-submit-new-email',
|
'/accounts/change-email/submit-new-email' => 'accounts/change-email-submit-new-email',
|
||||||
'/accounts/change-email/confirm-new-email' => 'accounts/change-email-confirm-new-email',
|
'/accounts/change-email/confirm-new-email' => 'accounts/change-email-confirm-new-email',
|
||||||
|
|
||||||
|
'/oauth2/v1/<action>' => 'oauth/<action>',
|
||||||
];
|
];
|
||||||
|
@ -16,13 +16,13 @@ class OauthController extends Controller {
|
|||||||
public function behaviors() {
|
public function behaviors() {
|
||||||
return ArrayHelper::merge(parent::behaviors(), [
|
return ArrayHelper::merge(parent::behaviors(), [
|
||||||
'authenticator' => [
|
'authenticator' => [
|
||||||
'except' => ['validate', 'issue-token'],
|
'except' => ['validate', 'token'],
|
||||||
],
|
],
|
||||||
'access' => [
|
'access' => [
|
||||||
'class' => AccessControl::class,
|
'class' => AccessControl::class,
|
||||||
'rules' => [
|
'rules' => [
|
||||||
[
|
[
|
||||||
'actions' => ['validate', 'issue-token'],
|
'actions' => ['validate', 'token'],
|
||||||
'allow' => true,
|
'allow' => true,
|
||||||
'roles' => ['?'],
|
'roles' => ['?'],
|
||||||
],
|
],
|
||||||
@ -38,9 +38,9 @@ class OauthController extends Controller {
|
|||||||
|
|
||||||
public function verbs() {
|
public function verbs() {
|
||||||
return [
|
return [
|
||||||
'validate' => ['GET'],
|
'validate' => ['GET'],
|
||||||
'complete' => ['POST'],
|
'complete' => ['POST'],
|
||||||
'issue-token' => ['POST'],
|
'token' => ['POST'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ class OauthController extends Controller {
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function actionIssueToken() {
|
public function actionToken() {
|
||||||
$this->attachRefreshTokenGrantIfNeedle();
|
$this->attachRefreshTokenGrantIfNeedle();
|
||||||
try {
|
try {
|
||||||
$response = $this->getServer()->issueAccessToken();
|
$response = $this->getServer()->issueAccessToken();
|
||||||
|
@ -9,17 +9,17 @@ use yii\codeception\BasePage;
|
|||||||
class OauthRoute extends BasePage {
|
class OauthRoute extends BasePage {
|
||||||
|
|
||||||
public function validate($queryParams) {
|
public function validate($queryParams) {
|
||||||
$this->route = ['oauth/validate'];
|
$this->route = '/oauth2/v1/validate';
|
||||||
$this->actor->sendGET($this->getUrl($queryParams));
|
$this->actor->sendGET($this->getUrl($queryParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function complete($queryParams = [], $postParams = []) {
|
public function complete($queryParams = [], $postParams = []) {
|
||||||
$this->route = ['oauth/complete'];
|
$this->route = '/oauth2/v1/complete';
|
||||||
$this->actor->sendPOST($this->getUrl($queryParams), $postParams);
|
$this->actor->sendPOST($this->getUrl($queryParams), $postParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function issueToken($postParams = []) {
|
public function issueToken($postParams = []) {
|
||||||
$this->route = ['oauth/issue-token'];
|
$this->route = '/oauth2/v1/token';
|
||||||
$this->actor->sendPOST($this->getUrl(), $postParams);
|
$this->actor->sendPOST($this->getUrl(), $postParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user