Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using OAuth 2.0 for Devices :Some requested scopes were invalid

Tags:

android

After you have the client ID and client secret, you send an HTTP POST to the OAuth 2.0 device endpoint at https://accounts.google.com/o/oauth2/device/code with your client_id and a list of scopes. Unlike the other OAuth 2.0 flows, response_type and redirect_uri are not needed in the device flow. The following is an example request for a user code:

POST /o/oauth2/device/code HTTP/1.1 Host: accounts.google.com Content-Type: application/x-www-form-urlencoded

client_id=812741506391-h38jh0j4fv0ce1krdkiq0hfvt6n5amrf.apps.googleusercontent.com& scope=email%20profile

I have tried but it results all time:

{ "error" : "invalid_scope", "error_description" : "Some requested scopes were invalid. {invalid=[[email protected]]}", "error_uri" : "http://code.google.com/apis/accounts/docs/OAuth2.html" }

can anyone solve this..where i am wrong please

like image 447
user3572796 Avatar asked Dec 12 '25 23:12

user3572796


1 Answers

You can start from here, this should help get you the device code

curl -d "client_id=xxxxxxxxxxxxxxxxx.apps.googleusercontent.com&scope=email profile" https://accounts.google.com/o/oauth2/device/code

like image 89
bmukorera Avatar answered Dec 14 '25 13:12

bmukorera



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!