Skip to content

raise exception when INVALID_OAUTHSCOPE error is answered by API #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thivolle-cazat-cedric
Copy link

@thivolle-cazat-cedric thivolle-cazat-cedric commented Dec 12, 2019

On my first try i had following exception:

  File "test.py", line 18, in <module>
    oauth_token = client.generate_access_token(grand_token)
  File "***Developpement/environements/**zohotest/lib/python2.7/site-packages/zcrmsdk/OAuthClient.py", line 182, in generate_access_token
    oAuthTokens.set_user_email(self.get_user_email_from_iam(oAuthTokens.accessToken))
  File "***Developpement/environements/**zohotest/lib/python2.7/site-packages/zcrmsdk/OAuthClient.py", line 213, in get_user_email_from_iam
    return response.json()['Email']
KeyError: 'Email'

Due to an INVALID_OAUTHSCOPE error when we want to set email from who iam endpoint.

the test.py file:

import zcrmsdk

cfg = {
'sandbox': "False",
'applicationLogFilePath': './log',
'client_id':'1000.***',
'client_secret':'***',
'redirect_uri':'http://127.0.0.1:8080/cb',
'accounts_url':'https://accounts.zoho.com',
'token_persistence_path':'./',
'access_type':'online',
'currentUserEmail':'***@***',
'apiVersion':'v2',
}
# scope=ZohoCRM.modules.ALL

zcrmsdk.ZCRMRestClient.initialize(cfg)
grand_token = "1000.*****"
client = zcrmsdk.ZohoOAuth.get_client_instance()
oauth_token = client.generate_access_token(grand_token)
print(oauth_token)

I get this issue with a "Self client" with scope : ZohoCRM.modules.ALL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant