-
Notifications
You must be signed in to change notification settings - Fork 51
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
[DOCS]: Implementation of GitHub App user authentication token with expiring disabled #517
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
Your code does not create a You user-to-server token can only be created using the web flow or the device flow. The Device flow needs to be enabled in the app in order for it to work.
Installation access tokens always expire after one hour. But if you pass the strategy to an |
Would you be kind enough to update the documentation or respond with sample code on how to generate a |
you cannot generate a It sounds like a common use case, I'd usually use an action like this to create an installation access token based on app credentials: https://github.com/gr2m/github-app-token-action and then use the resulting token in successive steps. However that token expires after one hour. For cases where a token is needed for tasks that take more than an hour, the tasks themselves need to accept the GitHub App credentials and create installation access tokens as needed |
At this point, we can create a |
yeah that should work. Note that user-to-server token expiration is a setting on the github app ("Optional features" tab in app settings) |
Describe the need
Attempting to create a
GitHub App user authentication token
with expiring disabled. (Sidenote, is it the same as auser-to-server token
? The language on docs is not clear.)We have a Github App
We have Opted-Out of the "User-to-server token expiration" in App Settings > Optional features.
Attempting to generate a non-expiring token using
@octokit/auth-app
We tried two approaches to generate a token, using JWT and Installation token as Authentication Objects for the
createOAuthUserAuth
function.JWT approach produces a token such as:
eyJhkGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2OTE2NjkzMDMsImV4cCI6MTY5MTY2OTkwMywiaXNzIjoyNzI1NjZ9.gaUOyjWkbm7NrfhNayPYwK1EzMyeUlEuWTTd7OEpBS91pY6wjCJx_giNOJBzNf0gzMwCyycxtjUCiMU1g6J0xgaYH_2iZxNeoakKYztHxccG8lzBUDCaTwgMBeeFxErlsW02WX8-b8nh0kEr07prYr7mwZFs2i5vEjgJznvk7NU7rzknXBzPeac5DZNq-NO6ikb_BTlMq1z7sW9SXU7xrEM8uHyVvk2KIYvkpwqRvoFBAeWuIIP1UotORxnLqAcLa5AIgOB3vg3Fonhv7d65NfbT9S1A6bfNjXJ25fZvzLoSRgCjTmR1St4MqgsK6O71ThjEk_GELnAm2LEwBt_VuQ
The installation token approach produces a token such as this. However, this expires in 1 hour.
ghs_knjVAQQVgpez6y4x6iBtm1BPkCLTlv33Zryn
Both tokens return
tokenType
asoauth
The documentation for
@octokit/auth-app
is not clear on how to disable expiry.SDK Version
3.388.0
API Version
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: