简体   繁体   中英

HTTP 403 error when fetching data from Google Classroom API with Swift iOS

I made an iOS app (Swift) that signs in with Google, then fetches classroom data from the (Google Classroom API) https://developers.google.com/classroom . Everything was working correctly, and then some time later I think I accidentally deleted the Google Cloud project associated with it. So I had to re-create it and recreate an OAuth Client ID (I followed this guide on Google's website).

Now I'm getting an https status code 403 error -Permission Denied while trying to fetch classes, and I have no idea why. Does anyone know how to resolve this?

I believe the specific error (according to the Google Classroom API error section, linked above) is:

在此处输入图像描述

...but I'm very confused what to do to fix this.

One thing that is interesting is when I created an OAuth Client ID and downloaded the credential.plist (or credential s - can't remember) file and inserted it into the Xcode project, I get the same error as when the.plist file is not there. I'm wondering if I have it named something incorrectly? (Because before I had an entire GoogleService-Info.plist file since I had an associated Firebase project), but now that I don't need the firebase project anymore, I just have the credentials in the downloaded plist file which inherently is called credentials.plist .

Edit One strange thing is that I am only trying to read data, so I don't know why it's telling me I attempted to modify data.

If you are using some of the API to manage the classwork from the students with the Classroom API, you could be affected by this alert :

在此处输入图像描述

This could be interpreted in a way that, all the CourseWork that was managed by the previous Client ID is basically linked to that Client ID. This also has been discussed over the public issue tracker when it comes to Classwork created from the normal UI and how it can be managed:

I would suggest to also share some feedback for this feature request so it gets the attention it needs. I notice that features like this for Classroom have been approved and implemented due to the high amount of users utilizing Classroom, generally it was previously limited however it has since been getting great support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM