Android query ws not authorized. OAuth 2.0

1

Good morning. I have to make a query to a WS to return an access_token, this WS has OAuth 2.0 security, I need to pass a client_id and client_secret, otherwise it returns 'unauthorized'. This is the cURL:

curl -X POST -vu <client_id>:<client_secret> http://<ip_ws>:8080/oauth/token -H "Accept: application/json" -d "password=<password>&username=<user>&grant_type=password&scope=read%20write&client_secret=<client_secret>&client_id=<client_id>"

From the Windows console I can perform the query, but I can not do this from my Android app, or PostMan. Do not know how to configure it to authenticate to OAuth 2.0

Is it possible to make a request with the cURL format? or you have to go to HttpURLConnection which I have not been able to use for these cases. Please respond with as much information as possible, libraries and more. Greetings!

    
asked by Lean Vitale 20.08.2016 в 21:52
source

0 answers