Ich habe einen Endpunkt mit OAuth2 und JWT gesichert, aber wenn zu authentifiziert, die versuchen, ich bin halten Sie die Störung zu erhalten: „Fehlende Erteilung Typ“. Ich habe versucht, den Content-Type-Header hinzuzufügen, wie in anderen Themen vorgeschlagen, aber es war nutzlos. Hier ist mein Curl-Befehl:Frühling Sicherheit OAuth2 Token-Fehler: „Fehlende Zuschuss Typ“
curl -vu aClient:aSecret -X POST --header "Content-Type:application/x-www-form-urlencoded" 'http://localhost:9000/oauth/token?username=mauricio.coder&password=123&grant_type=password'
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9000 (#0)
* Server auth using Basic with user 'aClient'
> POST /oauth/token?username=mauricio.coder&password=123&grant_type=password HTTP/1.1
> Host: localhost:9000
> Authorization: Basic YUNsaWVudDphU2VjcmV0
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Type:application/x-www-form-urlencoded
>
< HTTP/1.1 400
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< X-Frame-Options: DENY
< X-Application-Context: application:9000
< Cache-Control: no-store
< Pragma: no-cache
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Mon, 20 Nov 2017 12:34:10 GMT
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
{"error":"invalid_request","error_description":"Missing grant type"}
Gibt es etwas falsch?
Tks für die Antwort. Aber jetzt bekomme ich folgende Fehlermeldung: { „Fehler“: „unsupported_grant_type“, „ERROR_DESCRIPTION“: „Nicht unterstützte Erteilung Typ: Passwort“} – user2919910
Aber ich konfiguriert haben die AuthorizationServer es zu unterstützen: clients.authorizedGrantTypes („Passwort“, „refresh_token ") – user2919910