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

Update onedrive-authorize #40

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion onedrive-authorize
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo "https://login.live.com/oauth20_authorize.srf?client_id=${api_client_id}&sc
echo ""
echo "When ready, please enter the value of the code parameter (from the URL of the blank page) and press return"
read code
api_json_result=$(curl -s -d "client_id=${api_client_id}&client_secret=${api_client_secret}&code=${code}&grant_type=authorization_code&redirect_uri=https://login.live.com/oauth20_desktop.srf" -X POST "${api_auth_url}")
api_json_result=$(curl -s -d "client_id=${api_client_id}&code=${code}&grant_type=authorization_code&redirect_uri=https://login.live.com/oauth20_desktop.srf" -X POST "${api_auth_url}")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the official documentation, the parameter client_secret is required: https://dev.onedrive.com/auth/msa_oauth.htm#step-2-redeem-the-code-for-access-tokens

Even though it works without providing the secret, I would leave it there until Microsoft changes the documentation.


refresh_token=$(echo "${api_json_result}" | "${json_parser}" | grep -E "^refresh_token=" | cut -d= -f2-)
if [ "${refresh_token}" != "" ]; then
Expand Down