Wrong parameters for spring-security "/oaut/token" Endpoint
See original GitHub issueI’m not sure where is the problem but springfox generate this swagger.json (v2/api-docs) for spring-security /oaut/token endpoint:
"post":{
"tags":[
"token-endpoint"
],
"summary":"postAccessToken",
"operationId":"postAccessTokenUsingPOST_2",
"consumes":[
"application/json"
],
"produces":[
"*/*"
],
"parameters":[
{
"name":"parameters",
"in":"query",
"description":"parameters",
"required":true,
"items":{
"type":"object",
"additionalProperties":{
"type":"string"
}
}
}
],
I’s have required “parameters” in query but its need to be in body this is the right curl:
curl -iv -X POST --header "Accept:application/json" --header "Content-Type: application/x-www-form-urlencoded" -u fooClientIdPassword:secret "http://localhost:8081/oauth/token" -d "grant_type=password&client_id=fooClientIdPassword&username=john&password=123"
Can I change or override securityDefinitions for spring-security Endpoints ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Spring Oauth2 Error "Token not found in request parameters ...
I have resolved this problem after changing the order of WebSecurityConfigurerAdapter higher than the resource server.
Read more >Error handling for Spring Security Resource Server - Microflash
In this post, we'll discuss how to customize error handling for a REST API protected with OAuth 2 using Spring Security Resource Server....
Read more >OAuth2ParameterNames (spring-security-docs 6.0.0 API)
Standard and custom (non-standard) parameter names defined in the OAuth Parameters Registry and used by the authorization endpoint, token endpoint and token ......
Read more >Possible Errors - OAuth 2.0 Simplified
If one or more parameters are invalid, such as a required value is missing, or the response_type parameter is wrong, the server will...
Read more >spring-projects/spring-security-oauth - Gitter
@matin-reza Please change your configuration to also have .anyRequest().authenticated() . Also, you can change your method parameter to OAuth2Authentication ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have add this too:
and on swagger-js-codegen side:
if(form.parameters != undefined) form = form.parameters;
It works but its look like ugly fix for me. Let me know if you have better fix for thisThe plugin’s
apply
function is executed, but it doesn’t seem to matter.And no errors occur.