Wenn auf der Dokumentation Laravel 5.4 Implizite Grant Typ tun Antwort:
Warum Implizite Grants funktioniert nicht
Nach den Tutorial Ergebnisse in:
// 20170711152854
// http://oauth2server1/oauth/authorize?KEY=14997536295521&client_id=1&redirect_uri=http%3A%2F%2Fauthorizationgrantclient1%2Fcallback&response_type=token&scope=%3FXDEBUG_SESSION_START%3DECLIPSE`enter code here`_DBGP
{
"error": "unsupported_grant_type",
"message": "The authorization grant type is not supported by the authorization server.",
"hint": "Check the `grant_type` parameter"
}
============================================================================================
In dem impliziten Bewilligungstoken Anforderungscode wird eine Anforderung an: http://oauth2server1/oauth/authorize $ query
============================================================================================
die Handler von oauth/GET-Anfrage genehmigen ist: Laravel \ Passport \ Http \ Controllers \ AuthorizationController @ autorisieren nach php Handwerker Route: Liste
============================================================================================
... nach unten irgendwo die Linie
============================================================================================
In vendor\league\oauth2-server\src\AuthorizationServer.php -> function validateAuthorizationRequest()
/**
* Validate an authorization request
*
* @param ServerRequestInterface $request
*
* @throws OAuthServerException
*
* @return AuthorizationRequest
*/
public function validateAuthorizationRequest(ServerRequestInterface $request)
{
foreach ($this->enabledGrantTypes as $grantType)
{
if($grantType->canRespondToAuthorizationRequest($request)) // <— ValidationStartsHere
{
return $grantType->validateAuthorizationRequest($request);
}
}
throw OAuthServerException::unsupportedGrantType();
}
============================================================================================
... Irgendwo auf der ganzen Linie
============================================================================================
In vendor/league/oauth2-server/src/Grant/AuthCodeGrant.php -> function canRespondToAuthorizationRequest()
/**
* {@inheritdoc}
*/
public function canRespondToAuthorizationRequest(ServerRequestInterface $request)
{
return (array_key_exists('response_type', $request->getQueryParams()) // TRUE
&& $request->getQueryParams()['response_type'] === 'code' // FALSE
&& isset($request->getQueryParams()['client_id']) // TRUE
);
}
the values of the following variables are as follows:
$request->getQueryParams():
“KEY” => “14997536295521”,
“client_id” => “1”,
“redirect_uri” => “http://authorizationgrantclient1/callback”, // refer this value back to how to make an implicit grant token request
“response_type” => “token”,
“scope” => “”
als Effekt ... Dieser Code gibt immer false zurück, und die Ausführung von Code geht zurück an die aufrufende Funktion
============================================================================================
going back to vendor\league\oauth2-server\src\AuthorizationServer.php->validateAuthorizationRequest()
/**
* Validate an authorization request
*
* @param ServerRequestInterface $request
*
* @throws OAuthServerException
*
* @return AuthorizationRequest
*/
public function validateAuthorizationRequest(ServerRequestInterface $request)
{
foreach ($this->enabledGrantTypes as $grantType) {
if ($grantType->canRespondToAuthorizationRequest($request)) {
return $grantType->validateAuthorizationRequest($request);
}
}
throw OAuthServerException::unsupportedGrantType(); // <—looks familiar?
}
============================================================================================
... irgendwo auf der ganzen Linie
============================================================================================
In vendor\league\oauth2-server\src\Exception\OAuthServerException.php->function unsupportedGrantType()
/**
* Unsupported grant type error.
*
* @return static
*/
public static function unsupportedGrantType()
{
$errorMessage = 'The authorization grant type is not supported by the authorization server.';
$hint = 'Check the `grant_type` parameter';
return new static($errorMessage, 2, 'unsupported_grant_type', 400, $hint);
}
sieht sehr vertraut, oder?
Ich habe dieses Problem auch noch für eine Lösung über das Netz –