mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #3621] [bug]: Wrong URL format for OAuth authentication when using Azure B2C #1253
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#1253
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 @tigloo on GitHub (Dec 4, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3621
Is there an existing issue for this?
Current behavior
When using Azure B2C for OAuth, the auth URL has the user flow appended as first parameter:
https://tenantname.b2clogin.com/tenantname.onmicrosoft.com/oauth2/v2.0/authorize?p=b2c_1_user_flow_nameWhen Hoppscotch uses this URL to direct the user to the auth interface, it will append its parameters with
?but since the URL already contains?, Hoppscotch should use the&character.Steps to reproduce
Observed URL in the browser:
https://tenantname.b2clogin.com/tenantname.onmicrosoft.com/oauth2/v2.0/authorize?p=b2c_1_user_flow_name?other=parameters&go=hereRequired URL:
https://tenantname.b2clogin.com/tenantname.onmicrosoft.com/oauth2/v2.0/authorize?p=b2c_1_user_flow_name&other=parameters&go=here(Notice the use of two question marks in the first URL and the use of the ampersand in the second URL)
Environment
Production
Version
Cloud
@poorna-prakash-sr commented on GitHub (Dec 5, 2023):
Hi, can I work on this issue to resolve?
@tigloo commented on GitHub (Dec 5, 2023):
Feel free! Seems to me like the problem is here:
github.com/hoppscotch/hoppscotch@23afc201a1/packages/hoppscotch-common/src/helpers/oauth.ts (L210)The URL is composed with a hard-coded question mark. This should be made smarter to check if authUrl already contains a question mark.