title: Google classroom API Insufficient authentication scopes
body: <p>I try to add courseWork from <a href="https://developers.google.com/classroom/guides/manage-coursework" rel="nofollow noreferrer">the documentation</a> but It shows an <code>Request has insufficient authentication scopes</code> error.</p>
  
  <blockquote>
    <p>scopes are <a href="https://developers.google.com/classroom/guides/auth" rel="nofollow noreferrer">here</a></p>
  </blockquote>
  
  <p>I tried this:</p>
  
  <pre><code>from __future__ import print_function
  from apiclient.discovery import build
  from httplib2 import Http
  from oauth2client import file, client, tools
  
  store = file.Storage('credentials.json')
  creds = store.get()
  
  SCOPES = 'https://www.googleapis.com/auth/classroom.coursework.students'
  
  if not creds or creds.invalid:
      flow = client.flow_from_clientsecrets('client_secret.json', SCOPES)
      creds = tools.run_flow(flow, store)
  service = build('classroom', 'v1', http=creds.authorize(Http()))
  
  courseWork = {  
    'title': 'Ant colonies',  
    'description': 'Read the article about ant colonies and complete the quiz.',  
    'materials': [  
       {'link': { 'url': 'http://example.com/ant-colonies' }},  
       {'link': { 'url': 'http://example.com/ant-quiz' }}  
  ],  
    'workType': 'ASSIGNMENT',  
    'state': 'PUBLISHED',  
  }  
  courseWork = service.courses().courseWork().create(courseId='105332016379', body=courseWork).execute()  
  print('Assignment created with ID {0}'.format(courseWork.get('id')))
  </code></pre>
  
  <p>And error shows like this: </p>
  
  <p><a href="https://i.stack.imgur.com/zUbDN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zUbDN.png" alt="Error"></a></p>
  
  <p>So what will be the solution?</p>