Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions check-a-token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jq -n \

curl \
-X POST \
--user "${client_id}:${app_client_secret}" \
--user "${app_client_id}:${app_client_secret}" \
--header "X-GitHub-Api-Version: ${github_api_version}" \
--url "${GITHUB_API_BASE_URL}/applications/${client_id}/token" --data @${json_file}
--url "${GITHUB_API_BASE_URL}/applications/${app_client_id}/token" --data @${json_file}

4 changes: 2 additions & 2 deletions delete-an-app-authorization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jq -n \

curl \
-X DELETE \
--user "${client_id}:${app_client_secret}" \
--user "${app_client_id}:${app_client_secret}" \
--header "X-GitHub-Api-Version: ${github_api_version}" \
--url "${GITHUB_API_BASE_URL}/applications/${client_id}/grant" --data @${json_file}
--url "${GITHUB_API_BASE_URL}/applications/${app_client_id}/grant" --data @${json_file}
4 changes: 2 additions & 2 deletions delete-an-app-token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jq -n \

curl \
-X DELETE \
--user "${client_id}:${app_client_secret}" \
--user "${app_client_id}:${app_client_secret}" \
--header "X-GitHub-Api-Version: ${github_api_version}" \
--url "${GITHUB_API_BASE_URL}/applications/${client_id}/token" --data @${json_file}
--url "${GITHUB_API_BASE_URL}/applications/${app_client_id}/token" --data @${json_file}
2 changes: 1 addition & 1 deletion ghes-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ python3 configure.py --hostname ${hostname} \
--configure-app yes \
--app-id ${app_id} \
--installation-id ${installation_id} \
--client-id ${client_id} \
--client-id ${app_client_id} \
--team-members "${team_members}" \
--team-admin "${team_admin}" \
--default-committer "${default_committer}" \
Expand Down
4 changes: 2 additions & 2 deletions oauth-device-flow-step3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ echo ========== Step 3: Create step 3 device flow file =======================
echo
echo
jq -n \
--arg client_id "${client_id}" \
--arg app_client_id "${app_client_id}" \
--arg device_code "${device_code}" \
--arg grant_type "${grant_type}" \
'{ client_id: $client_id, device_code: $device_code, grant_type: $grant_type }' > ${json_file}
'{ client_id: $app_client_id, device_code: $device_code, grant_type: $grant_type }' > ${json_file}
cat ${json_file} | jq -r
echo
echo ========================================================================
Expand Down
4 changes: 2 additions & 2 deletions oauth-device-flow-steps1-and-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ step1_response_file=tmp/step1-response.json
scope="read:enterprise"

jq -n \
--arg client_id "${client_id}" \
--arg app_client_id "${app_client_id}" \
--arg scope "${scope}" \
'{ client_id: $client_id, scope: $scope }' > ${json_file}
'{ client_id: $app_client_id, scope: $scope }' > ${json_file}

echo ========== Step 1: json file for client and scope ======================
echo
Expand Down
4 changes: 2 additions & 2 deletions oauth-renew-access-token-and-refresh-token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ echo "grant_type: ${grant_type}"
jq -n \
--arg refresh_token "${refresh_token}" \
--arg grant_type "${grant_type}" \
--arg client_id "${client_id}" \
--arg app_client_id "${app_client_id}" \
--arg client_secret "${client_secret}" \
'{ refresh_token: $refresh_token, grant_type: $grant_type, client_id: $client_id, client_secret: $client_secret }' > ${json_file}
'{ refresh_token: $refresh_token, grant_type: $grant_type, client_id: $app_client_id, client_secret: $client_secret }' > ${json_file}

cat ${json_file} | jq -r

Expand Down
2 changes: 1 addition & 1 deletion proxima-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ python3 configure.py --hostname "${hostname}" \
--app-id "${app_id}" \
--app-client-secret "${app_client_secret}" \
--installation-id "${installation_id}" \
--client-id "${client_id}" \
--client-id "${app_client_id}" \
--team-members "${team_members}" \
--team-admin "${team_admin}" \
--default-committer "${default_committer}" \
Expand Down
4 changes: 2 additions & 2 deletions reset-a-token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jq -n \

curl \
-X PATCH \
--user "${client_id}:${app_client_secret}" \
--user "${app_client_id}:${app_client_secret}" \
--header "X-GitHub-Api-Version: ${github_api_version}" \
--url "${GITHUB_API_BASE_URL}/applications/${client_id}/token" --data @${json_file}
--url "${GITHUB_API_BASE_URL}/applications/${app_client_id}/token" --data @${json_file}

4 changes: 2 additions & 2 deletions tiny-github-app-oauth-renew-access-token-and-refresh-token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ echo "grant_type: ${grant_type}"
jq -n \
--arg refresh_token "${refresh_token}" \
--arg grant_type "${grant_type}" \
--arg client_id "${client_id}" \
--arg app_client_id "${app_client_id}" \
--arg client_secret "${app_client_secret}" \
'{ refresh_token: $refresh_token, grant_type: $grant_type, client_id: $client_id, client_secret: $client_secret }' > ${json_file}
'{ refresh_token: $refresh_token, grant_type: $grant_type, client_id: $app_client_id, client_secret: $client_secret }' > ${json_file}

cat ${json_file} | jq -r

Expand Down
2 changes: 1 addition & 1 deletion tiny-github-app-oauth-web-application-flow-step1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ then
fi


open -n -a "Google Chrome" --args --profile-directory="${chrome_profile}" "http://${hostname}/login/oauth/authorize?client_id=${client_id}"
open -n -a "Google Chrome" --args --profile-directory="${chrome_profile}" "http://${hostname}/login/oauth/authorize?client_id=${app_client_id}"
2 changes: 1 addition & 1 deletion tiny-github-app-oauth-web-application-flow-step2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ code=$1
curl ${curl_custom_flags} -L \
-H "Accept: application/vnd.github.v3+json" \
-X POST \
"http://${hostname}/login/oauth/access_token?client_id=${client_id}&client_secret=${app_client_secret}&code=${code}" | jq -r
"http://${hostname}/login/oauth/access_token?client_id=${app_client_id}&client_secret=${app_client_secret}&code=${code}" | jq -r