0

So basically: I have used google oauth2 to be able to login the user with google classroom api scopes (such as classroom.courses.readonly) using the react-google-login module. However: how would I get data such as the user's courses/student rosters in those courses?

FYI: I'm trying to get a list of the user's courses and lists of the students inside those courses. I would appreciate any help given, I've been working on this issue for many days now.

Heres the React code:

import GoogleLogin from 'react-google-login';

const clientID = process.env.REACT_APP_CLIENT_ID;

const onGoogleSuccess = (res) => {
    console.log(res);
    window.localStorage.setItem('token', res.tokenId);
}
<GoogleLogin 
    clientId={clientID}
    buttonText="Login"
    onSuccess={onGoogleSuccess}
    cookiePolicy="single_host_origin"
    scope="openid https://www.googleapis.com/auth/classroom.courses.readonly"
    isSignedIn={true}
/>
Vamp
  • 65
  • 1
  • 7

0 Answers0