title: WSO2 Identity and Oauth2 - Userinfo throws Error: Insufficient Scope
body: <p>Testing the oauth2/userprofile query for Oauth2 with the following Python code: </p>
  
  <pre><code>        verify='/home/claudef/tmp/oauth2/oauth/wso2.pem'
          url  = "https://extbasicpacman05.podc.sl.edst.red.com:9443/oauth2/userinfo?schema=openid"
          headers = { 'Authorization' : "Bearer " + access_token } 
          r = requests.get(url, headers=headers, verify=verify)
  </code></pre>
  
  <p>I get the following error message from the WSO2 Identity server: </p>
  
  <pre><code>error":"insufficient_scope","error_description":"Access token does not have the openid scope"
  </code></pre>
  
  <p>Checking the data that returns from the bearer token emission, I see a default value of scope=profile, which does not match the default in the userinfo query, what likely uses the value scope=openid.   </p>
  
  <pre><code>u'token_type': u'bearer', u'scope': u'profile', u'access_token': u'7ae4542fe322d3aba67bf0625039d5f6', u'expires_in': 73, u'refresh_token': u'92d915a25d8bef6ca7ec7b70664c5cbf'}
  </code></pre>
  
  <p>The same error also shows up  when using a cURL command. </p>
  
  <p>Please give me some guidance how fix this issue to read userinfo data from the WSO2 server. </p>