私はoauth2-azureを使用しています。Azure AD OAuth2は、資格情報を入力した後、Microsoftログインにリダイレクトします。
ログインページにリダイレクトした後https://login.microsoftonline.com/common/oauth2/authorize?state=zzz&scope=&response_type=code&approval_prompt=auto&redirect_uri=http%3A%2F%2Fexample.org&client_id=xxx
次のパターンがループ:
- 資格情報を入力し、(いずれかのparamsをGETなし)
- ページ
https://login.microsoftonline.com/login.srf
にリダイレクト - 後藤1
ログイン質問は、なぜそれがhttp://example.org
にリダイレクトされないのですか?なぜそれはログインフォームにリダイレクトし続けますか?ページにエラーはありません。
コード:私はcommon
とMicrosoftアカウントのログインを設定することで、あなたの問題を再現でき
use TheNetworg\OAuth2\Client\Provider\Azure;
// ...
$clientId = "xxx";
$clientSecret = "yyy";
$redirectUri = "http://example.org";
$provider = new Azure(array
(
"clientId" => $clientId,
"clientSecret" => $clientSecret,
"redirectUri" => $redirectUri
));
if (!isset($_GET["code"]))
{
$authUrl = $provider->getAuthorizationUrl();
$_SESSION["oauth2state"] = $provider->getState();
header("location: $authUrl");
die();
}
// Validate state, get access token etc...
をありがとう、問題を修正! Azure AD V2.0を動作させることができませんでした。「https://login.live.com/err.srf?lc = 1033#error = unauthorized_client&error_description = +クライアント+ does not not exist ...」私が試したすべての有効な範囲のURL。 – bloodleh
azure ad v2.0のappは、apps.dev.microsoft.comに登録する必要があります。 [v2.0エンドポイントについての相違点](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-compare)を参照してください。 –
ありがとう、私もそれを調べます。 – bloodleh