mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #4277] [bug]: Microsoft AAD Entra-ID implicit token flow -Origin header changed by using CORS-Plugin #1554
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1554
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HolgerBearBaer on GitHub (Aug 19, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4277
Is there an existing issue for this?
Current behavior
We would like to use Microsoft EntraID OAuth for a request. For this we need the CORS plugin, but we always get a "Bad Request" error when we try to get an OAuth token.
We would like to use the implicit grant flow for AAD-registered apps (https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-implicit-grant-flow?WT.mc_id=Portal-Microsoft_AAD_RegisteredApps) - especially the section "acquire-access-tokens-silently" (https://learn.microsoft.com/de-de/entra/identity-platform/v2-oauth2-implicit-grant-flow?WT.mc_id=Portal-Microsoft_AAD_RegisteredApps#acquire-access-tokens-silently). The request should call a user token from an already authenticated session from Hoppscotch GUI via CORS Plugin (implicit authentication).
If the access token endpoint is called, Microsoft checks that the Origin header is specified accordingly in the app registration. Unfortunately, either Hoppscotch or the Hoppscotch-CORS plugin replaces the Origin header given in the request with the Chrome extension ID (chrome-extension://amknoiejhlmhancpahfcfcfhllgkpbld). Since Microsoft (EntraID) does not allow a chrome-extension to be set as a source in the application, this poses a problem because Entra-ID does not accept the Hoppscotch plugin Chrome-Extension-ID as a SinglePageApplication and therefore produces the following error message:
Steps to reproduce
Expected behaviour:
Hoppscotch and the Hoppscotch-CORS plugin respects a Origin header specification in the request and do not simply change it while request flow.
Environment
Production
Version
Self-hosted
@MightyGoldenJA commented on GitHub (Sep 10, 2024):
We can also reproduce it using the plugin with a self-hosted deployment when trying to to access
https://login.microsoftonline.com/<ID>/oauth2/v2.0/token.