0

I have an application set up to access the Google Classroom API. I have it authorized and can pull Course and Roster data. It's updated to use the V1 calls, but when I add in the Profile.Name and Profile.Email scopes, I get the following error:

{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "message" : "Unregistered request was blocked. Please sign up using Google Developers Console.",
    "reason" : "forbidden"
  } ],
  "message" : "Unregistered request was blocked. Please sign up using Google Developers Console.",
  "status" : "PERMISSION_DENIED"
}

The service account has been authorized in the admin console with all 4 relevant Classroom scopes. The Domain has also been confirmed as having the Classroom APIs enabled, if I attempt to use them through the OAuth playground it all works fine.

Any ideas as to why I'm getting the error only when I add in the profile scopes?

Crazyjavahacking
  • 9,343
  • 2
  • 31
  • 40
Hershey108
  • 38
  • 4
  • can you please post the scopes with which you are seeing the issue? because in both Documentation and oauth playground, I see only this scope https://www.googleapis.com/auth/classroom.profile.emails and https://www.googleapis.com/auth/classroom.profile.photos – SGC Jul 10 '15 at 16:29
  • Apologies for the lack of clarity, those are the scopes I am using (classroom.profile.email/photos). Full scopes: https://www.googleapis.com/auth/classroom.rosters https://www.googleapis.com/auth/classroom.courses https://www.googleapis.com/auth/classroom.profile.photos https://www.googleapis.com/auth/classroom.profile.emails – Hershey108 Jul 14 '15 at 11:06
  • This error is general thrown if there is issue with your API key. Is your API key is valid? Also, did you include it in your request. Please check that you have included the entire key in your request. – SGC Jul 14 '15 at 16:45
  • I am using a service account with a p12 file to authenticate my requests. It works fine for the classroom.courses and classroom.rosters scopes, I can make my requests and retrieve the information I need. The only change to code I make is to add the other 2 scopes, and then it breaks. – Hershey108 Jul 15 '15 at 09:55
  • Have you also added those scopes to the service account in the Google Admin console? When you approve a service account for domain-wide access, you also specify the scopes you are approving. If you want to use new scopes, you'll need to add them there as well. – Eric Koleda Jul 23 '15 at 17:30
  • Yep, I'd done all that. Turns out we needed Google to run through a second round of authorizing the domain for the new Classroom functionality, which wasn't clear coming out of the beta. Thanks for your help, SGC & Eric! – Hershey108 Jul 28 '15 at 14:30

1 Answers1

1

The issue was that we were required to fill in a second form for Google to authorize the domain, we'd only found the first one. After filling in the new form, it all started working.

Hershey108
  • 38
  • 4