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

cannot unmarshal string into Go struct field TokenResponse.expires_in of type int64 #120

Closed
cluther opened this issue Jan 11, 2025 · 1 comment

Comments

@cluther
Copy link
Contributor

cluther commented Jan 11, 2025

Thank you for oauth2c! It's a useful tool that has helped me avoid writing one-off scripts on several occasions.

I was recently trying to use it to get a refresh token from login.microsoft.com, and encountered the following error.

failed to parse exchange response: json: cannot unmarshal string into Go struct field TokenResponse.expires_in of type int64

This happens because Microsoft has decided they're going to return expires_in as a JSON string instead of number. This seems to be a violation of the OAuth2 spec but they're doing it nonetheless.

I opened the pull request #119 with something that fixes it for me. Would you please take a look?

@mbilski
Copy link
Contributor

mbilski commented Jan 13, 2025

Thank you! I've merged the PR and released it as v1.17.1

@mbilski mbilski closed this as completed Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants