Trying to access courses.students.list for Google Classroom API - google-oauth

I am trying to access the student list endpoint for Google Classroom.
I have successfully obtained my OAUTH2 token, I have requested the following scopes:
userinfo.email
userinfo.profile
classroom.profile.emails
classroom.courses.readonly
classroom.coursework.me
classroom.coursework.students
Every time that I try to retrieve the class list I am getting a 403 Permission denied and I'm wondering what I'm doing wrong.
Two things to mention: Here is a screenshot showing the permissions I have granted:
And, interestingly, even after having added the permissions, on the google project page where it lists the number of users using sensitive scopes - it is listed as zero (which is odd, I'd have thought it should be 1)
Any pointers would be really helpful!

Not a very satisfactory answer, but, if I add the https://www.googleapis.com/auth/classroom.rosters.readonly scope, then it allows me access and returns the email addresses at the same time (when calling the v1/courses/{courseId}/students endpoint)
If however you only have the rosters scope, then you can still access the v1/courses/{courseId}/students endpoint, but, you just don't get the email addresses returned.
Quite confusing to me.

Related

Slack Enterprise list all files/conversations

is it possible to list all of the conversations in my slack organization using the API?
Or for the very least, within a workspace.
When I tried calling the "conversations.list" endpoint using a token with an enterprise token, I got an "enterprise_is_restricted" error.
When I invoked the same endpoint with a workspace token, I got a list of all of the public channels, and IM's that I'm a member of, but private conversations that my user (the primary owner) is not a member of were not retreived. Now it makes sense that I wouldn't be able to read them, but I'm looking for a way to list them, to get their name and members basically.
And than with files. I got the same "enterprise_is_restricted" error when I used my enterprise app token, and when I used a specific workspace token, I only got files that were shared with me. I want to be able to keep track of what files are being shared and with whom (for information security reasons), so this is very problemetic for me.
Yes it is possible. The following should give you at least permissions to all conversations within the workspace.
Generate an OAuth Access Token for your Slack app
Go to api.slack.com to set permissions for it. This particular method needs the following scopes: "channels:read,groups:read,mpim:read,im:read"
Install/reinstall the app and use that OAuth token to access your list of conversations

Google Classroom API courses.teachers.create

I'm trying to use the courses.teachers.create method but I can't get it to work, error 403 returns.
code 403 message {The caller does not have permission} status PERMISSION_DENIED
My API if authorized to allow users to create courses, according to the scope indicated in the API documentation.
And already check the user and if you have CREATE permissions but it still does not work, it is the only method that does not work for me, because when I try to eliminate a teacher everything works correctly.
I already did tests on the API reference page and it shows me the same error.
I found the problem, and it is because to be able to create teacher it is necessary that my account be a domain administrator.

Registration with Google API

I'm trying to implement Login and Registration to my React App with the Google API. I can't figure out the correct way to register a new user with the information that Google provides (the GoogleAuth Object).
After a successful login with the popup window, the GoogleAuth object (I will call it 'dict' from now on) gives me a lot of info, some of it I don't know what is exactly, there are some access tokens (that repeats over the dict) and the main info of the profile of the user (name, mail, googleID, etc),
I also notice that the "googleID" repeats over the dict but with different names (same as other info)(there is more info that relates to the tokens as "expiration", "first issued", etc but I believe I do not need that).
I'm guessing that the tokens are used to GET and POST info from and/or to Google Account (I kinda understand how JWT works).
So my questions are:
Can someone explain me what is all the info and why it is repeated in the dict? (for example the number in dict.El also appears in dict.profileObj.googleId and dict.w3.Eea and dict.googleId)
Since my registration method needs Name, Mail and Password, the main question is:
What should I put in the password field?
The GoogleId? if so, is it secure?
The Token? I think no because it expires right?
Thanks for your help

How to do a server call to Deezer APIs using the access token of a free user

something like this
$xml = file_get_contents('http://api.deezer.com/2.0/artist/27/top?access_token=.....');
works if the access_token belongs to a premium user, otherwise it doesn't work. When I say it doesn't work it means that taccess_token is not considered, so for example the country of the user is not token into consideration and if the code run on a US server, the above call just gives an empty answer (because no song is allowed).
Months ago the deezer team told me that they were close to modify this in order to correctly pass the access token also for free users, but I have just tried and the issue is still there.
Is there any workaround (apart from calling the API via javascript)?
Thanks.
Regarding that issue, to make things clear:
Requests coming from US servers will receive empty data, because Deezer's not available there,
You can work around that issue by passing an access_token parameter with the request. If the access_token is associated with a Premium user who registered in a Deezer live country (e.g. Italy for example), the request will take the user country associated with the token into account. Therefore, it will return results.
That above workaround isn't working for free users.
This is a widely known issue and we are working on another workaround right now.

Facebook group wall on some other website

I made a application which shows facebook group wall on the other website. I would like to know if it is possible that users which comes to this other website don't have to grant their permissions. The facebook group is public and everything is shared without any special permissions. Also would like to know if it is possible to show group wall feed without user logged in?
Do you have any solutions?
"The facebook group is public and everything is shared without any special permissions."
One of the strange things about the Graph API, to get public information from much of it, will require an access token, even though that information is "public". I've scratched my head about that for a long time, and haven't come up with any other answer than "the API is provided by Facebook and we must play by their rules when in their sandbox".
So, you will need to get an access token from at least one person to do what you are requesting. (At least you wouldn't have to ask every user!)
You will need to ask your user for user_group access and then you can grab {group_id}/feed. What you might want to do is get a non-expiring token from one of the original members or even yourself by requesting offline_access. Then always use that token to get the feed. (Remember, when you change your password, the offline_access token will be invalidated and will need to get a new one).