mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #3138] [MERGED] fix: Self-host unable to use Azure oauth #4246
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#4246
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?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/3138
Author: @domestic-fennec
Created: 6/14/2023
Status: ✅ Merged
Merged: 6/22/2023
Merged by: @AndrewBastin
Base:
release/2023.4.7← Head:fix/GH-3050📝 Commits (2)
472f7bafix: Self-host unable to use Azure oauth13030edfeat: allow azure tenant to be specified for microsoft auth📊 Changes
2 files changed (+2 additions, -1 deletions)
View changed files
📝
.env.example(+1 -0)📝
packages/hoppscotch-backend/src/auth/strategies/microsoft.strategy.ts(+1 -1)📄 Description
Closes #3050 #3139
Description (bugfix)
The
passReqToCallback=truealters the arguments passed toMicrosoftStrategy.validatesuch that first argument is arequestobject and other arguments are shifted across one. This meant that actual values foraccessTokenand criticallyprofileweren't in the expected arguments and therefore the rest of the method would break. I believepassReqToCallbackwas added in error in81cb0d43d7. This method could never work in it's current form with this option set to true.This has been tested (and previously debugged) on a private instance of hopscotch so I can confirm that this method does now indeed work in "production"
Description (feature)
Many orgs using Azure AD will be running on their own "tenants" rather than the "common" tenant, and therefore need to be able to specify a tenant ID to allow oauth2 url's to be correctly generated by passport-microsoft. This change allows setting the tenant ID as the
MICROSOFT_TENANTenv var.See passportjs.org/packages/passport-microsoft for more detail.
Checks
Additional Information
none
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.