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

clarify instructions in readme.md #569

Closed
2 tasks done
M00NSH0T opened this issue Feb 21, 2022 · 7 comments · May be fixed by #618
Closed
2 tasks done

clarify instructions in readme.md #569

M00NSH0T opened this issue Feb 21, 2022 · 7 comments · May be fixed by #618
Labels

Comments

@M00NSH0T
Copy link

M00NSH0T commented Feb 21, 2022

Overview/summary

Step 4 in the instructions include a line:

access_token = session.request_token(request_params)

But it's unclear from a lamen's perspective what request_params should be. Please add some clarification around how to define request_params.

Motivation

What inspired this enhancement?

Tring to get up and running quickly with the API...

Area

  • Add any relevant Area: <area> labels to this issue

Checklist

  • I have described this enhancement in a way that is actionable (if possible)
@mllemango
Copy link
Contributor

Hey @M00NSH0T, you raise a really good point. The team will add it to the backlog, in the meantime we always welcome PRs!

@eporto2021
Copy link

eporto2021 commented Apr 27, 2022

Can someone help a lamen out and clarify exactly what needs to be passed to the request_token() function, say with an example of 'request_params' ?

@tamirble
Copy link

I was stuck here too. This is how I solved it.

code_you_got_from_redirection = "********"

session = shopify.Session(shop_url, api_version)

timestamp = time()
request_params = {
    'timestamp': timestamp,
    'code': code_you_got_from_redirection
}

hmac_ = session.calculate_hmac(request_params)
request_params['hmac'] = hmac_
access_token = session.request_token(request_params)

@ianjosephwilson
Copy link

@tamirble The code is hard to follow but I think the timestamp and hmac should be provided by shopify via a GET argument. The library checks the hmac is correct to verify the request was sent by shopify. There is also a check against the timestamp.

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.

@github-actions
Copy link

github-actions bot commented Nov 5, 2022

We are closing this issue because it has been inactive for a few months.
This probably means that it is not reproducible or it has been fixed in a newer version.
If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.

If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines

Thank you!

@github-actions github-actions bot closed this as completed Nov 5, 2022
@li5tun
Copy link

li5tun commented Dec 7, 2023

the parameters from step 3 must be like this: code=abcd1234&hmac=aaaaaaaa&host=asdfasdf&shop=abc.myshopify.com&state=aaaaaaa&timestamp=12345, convert it to a dict:

request_params = { 'code': 'abcd1234', 'hmac': 'aaaaaaaa', 'host': 'asdfasdf', 'shop': 'abc.myshopify.com', 'state': 'aaaaaaa', 'timestamp': 12345, }

timestamp is a # INTEGER

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

Successfully merging a pull request may close this issue.

6 participants