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 script for generating a JWT for a github app fails #36104

Open
1 task done
frjtrifork opened this issue Jan 30, 2025 · 2 comments · May be fixed by #36105
Open
1 task done

Python script for generating a JWT for a github app fails #36104

frjtrifork opened this issue Jan 30, 2025 · 2 comments · May be fixed by #36105
Labels
content This issue or pull request belongs to the Docs Content team

Comments

@frjtrifork
Copy link

frjtrifork commented Jan 30, 2025

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app

What part(s) of the article would you like to see updated?

https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app#example-using-python-to-generate-a-jwt

Reason:
In a fresh python installation the python script for getting a JWT in the article needs both the 'PyJWT' and the 'cryptography' pip packages installed.

Can be verified using a fresh docker python:3-alpine image:

docker run -v $(pwd):/app -w /app python:3-alpine \
  sh -c 'pip install PyJWT; python githubJwt.py ghapp.private-key.pem CLIENT_ID'

The command above will throw an error:
NotImplementedError: Algorithm 'RS256' could not be found. Do you have cryptography installed?

If you add the cryptography package to the pip install line, the same script invocation works:

docker run -v $(pwd):/app -w /app python:3-alpine \
  sh -c 'pip install PyJWT cryptography; python githubJwt.py ghapp.private-key.pem CLIENT_ID'

Additional information

No response

@frjtrifork frjtrifork added the content This issue or pull request belongs to the Docs Content team label Jan 30, 2025
Copy link

welcome bot commented Jan 30, 2025

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Jan 30, 2025
@frjtrifork frjtrifork linked a pull request Jan 30, 2025 that will close this issue
3 tasks
@subatoi
Copy link
Contributor

subatoi commented Jan 30, 2025

Hi @frjtrifork—thanks for opening an issue and linking it to your PR. I'll get the latter triaged for review by a member of the team. Many thanks

@subatoi subatoi removed the triage Do not begin working on this issue until triaged by the team label Jan 30, 2025
@github github deleted a comment Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants