public static function checkId($client_id) { $model = OauthClient::findOne($client_id); if (!$model) { throw new ForbiddenHttpException("Invalid Client Id.", 10031); } return $model; }
public function checkClientId($client_id) { $client = OauthClient::findOne(['client_id' => $client_id, 'grant_type' => self::GRANT_TYPE_AUTHORIZATION_CODE]); if (!$client) { return self::$ERR_CLIENT_ID_NON_EXISTS; } // TODO: Check if the client id has the permission to authorize. return true; }