Skip to content
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

Python Error: error_code: invalid_grant, error_description: AADSTS70000: The request was denied because one or more scopes requested are unauthorized or expired. The user must first sign in and grant the client application access to the requested scope #284

Open
menporulporiayalan opened this issue May 28, 2024 · 0 comments

Comments

@menporulporiayalan
Copy link

menporulporiayalan commented May 28, 2024

Hello,

I am getting this error while I am fetching 'authorization_data'. But it is running good in my staging and local environment but its not working in my production.

I have cross-checked my 'developer_token', 'client_id' and 'client secret' multiple times. It is all good still I am still getting this error.


def find_customerid(shop_id, refresh_token):
       authorization_data = set_authorization(shop_id,None, None, refresh_token)
       customer_service = ServiceClient(service='CustomerManagementService', version=13, authorization_data=authorization_data, environment='production')

def set_authorization(shop_id,account_id, customer_id, refresh_token):
     authorization_data = AuthorizationData(
		account_id= account_id,
		customer_id= customer_id,
		developer_token= developer_token',
		authentication= OAuthWebAuthCodeGrant(
			client_id= my_client_id,
			client_secret=my_client_secret,
			redirection_uri=my_redirection_uri,
			)
		)
    	authorization_data.authentication.request_oauth_tokens_by_refresh_token(refresh_token)
     	return authorization_data

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

No branches or pull requests

1 participant