我需要解决以下问题:我使用Laravel创建了两个应用程序。
https://test.example.org
访问User
)。 https://test.org
到达并使用API 应用程序A使用存在于[[应用程序A中的“ API用户”提供的API用户”来获取“公共”数据应用程序B
的用户提供一种登录方法。 Application A中存在所有使用Application B的用户。因此,登录Application B的用户正在使用保存在Application A中的凭据。在Application A中对用户所做的所有更改应该在Application B上可见。现在,我不知道该怎么办。任何想法如何解决这个问题?我可以想象使用带有的API调用 $client = $this->client;
try {
return $client->request('POST',
'https://'.config('server').'/oauth/token', [
'headers' => [
'cache-control' => 'no-cache',
'Content-Type' => 'application/x-www-form-urlencoded',
],
'form_params' => [
'client_id' => ...,
'client_secret' => ...,
'grant_type' => 'password',
'username' => $users-username,
'password' => $users-password,
],
]);
} catch (BadResponseException $e) {
return $e->getResponse();
}
}
但是我不知道,是否需要为上的每个用户创建一个Application A
client_id
和client_secret
。如果是这种情况,我需要将这些信息存储在某个地方,以便最终在Application B本身上创建一个User
模型。我的问题是: