Skip to content

Allow sending HTTP origin header for token requests#441

Open
jimdigriz wants to merge 1 commit into
mguessan:masterfrom
jimdigriz:token-origin
Open

Allow sending HTTP origin header for token requests#441
jimdigriz wants to merge 1 commit into
mguessan:masterfrom
jimdigriz:token-origin

Conversation

@jimdigriz
Copy link
Copy Markdown

Some client ID's, in particularly Single Page Applications (SPAs), require that an HTTP origin header be sent to be able to exchange your code/refresh_token for an access token.

This PR allows this, discovered whilst working through #440.

To be applied after #439, this commit was originally part of that PR but it was requested that it be broken out.

@esabol
Copy link
Copy Markdown

esabol commented Jan 26, 2026

I think you (accidentally?) included the Graph fix in this PR, @jimdigriz. This PR should only have the Origin commit.

@jimdigriz
Copy link
Copy Markdown
Author

Doh, resolved.

Copy link
Copy Markdown

@esabol esabol left a comment

Choose a reason for hiding this comment

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

OK, LGTM!

Not providing an origin can lead to:

ERROR [ImapConnection-48912] davmail.exchange.auth.O365Token  - refresh token failed invalid_request AADSTS9002327: Tokens issued for the 'Single-Page Application' client-type may only be redeemed via cross-origin requests. Trace ID: ... Correlation ID: ... Timestamp: ...
@esabol
Copy link
Copy Markdown

esabol commented May 9, 2026

@mguessan : Any comments on this patch? While I don't need this feature personally, it sounds useful, and the patch is small and unobtrusive.

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

Successfully merging this pull request may close these issues.

2 participants