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

Non-standard token response #526

Open
sagikazarmark opened this issue Oct 24, 2021 · 1 comment
Open

Non-standard token response #526

sagikazarmark opened this issue Oct 24, 2021 · 1 comment

Comments

@sagikazarmark
Copy link
Contributor

I honestly don't know why anyone would ever do this, but some providers think it's a good idea to serve tokens in an arbitrary format.

Currently it requires rewriting a considerable amount of code to support these custom responses. It would be nice if it would be easier to hook into the token parsing flow.

I understand that supporting implementations deviating from standards is an endless debate (khm...HTTP), so I understand if this never lands in the library, but I thought I'd start a discussion at least.

I'd be happy to work on this if the maintainers decide that they would allow to land something like this.

I've found a similar issue describing a very specific case here: #197

@andig
Copy link
Contributor

andig commented Nov 22, 2021

@sagikazarmark I support this, see #484 for a specific, imho wide-spread use case.

I understand that supporting implementations deviating from standards is an endless debate (khm...HTTP), so I understand if this never lands in the library, but I thought I'd start a discussion at least.

I would suggest to make the token unmarshaling a configurable process, maybe per refreshable token source. See https://github.com/evcc-io/evcc/blob/master/util/oauth/tokensource.go for a hacked-together version that will also support custom token refresh processes.

I would also like to work on this. Unfortunately it seems that there is currently little feedback on issues from outside Google, maybe @bradfitz could help?

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