我正在尝试从laravel护照中检索令牌但没有回复,这是我的代码..
登录
public void getToken(){
final String url = "http://10.96.2.159/chat/public/oauth/token";
StringRequest str = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
msgResponse.setText("Work!");
}
}
, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> params = new HashMap<String, String>();
params.put("client_id","2");
params.put("client_secret","token");
params.put("grant_type","password");
params.put("username","user1@tracer.com");
params.put("password","anu12345");
return params;
}
};
}
感谢