包装Oauth2回复

时间:2016-04-19 07:51:53

标签: spring spring-security

如何修改oauth2响应:

现有:

{    
  "access_token": "25313d2c-3d24-429c-ab42-39f712aa7d8f",    
  "token_type": "bearer",    
  "refresh_token": "da9d14c5-32aa-44c1-8c64-83244b85e150",    
  "expires_in": 27843637    
}

要求:

{    
  "success":true,    
  "access_token": "25313d2c-3d24-429c-ab42-39f712aa7d8f",    
  "token_type": "bearer",    
  "refresh_token": "da9d14c5-32aa-44c1-8c64-83244b85e150",    
  "expires_in": 27843637    
}

同样出现任何身份验证问题: 现有:

{    
  "error": "invalid_grant",    
  "error_description": "Bad User Credentials."    
}

要求:

{    
  "success":false,    
  "error": "invalid_grant",    
  "error_description": "Bad User Credentials."    
}

或者我可以完全自定义json。

请帮助我,我尝试了很多方法,但没有工作。

0 个答案:

没有答案