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

Fix HybidSample running #6717

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion samples/msal-browser-samples/HybridSample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"express-session": "^1.17.2",
"hbs": "^4.0.4",
"http-errors": "~1.6.3",
"morgan": "~1.9.1"
"morgan": "~1.9.1",
"yargs": "^17.7.2"
},
"devDependencies": {
"nodemon": "^2.0.12"
Expand Down
9 changes: 3 additions & 6 deletions samples/msal-browser-samples/HybridSample/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ router.use('/lib', express.static(path.join(__dirname, '../node_modules/@azure/m
router.get('/login', (req, res) => {
const authCodeUrlParameters = {
scopes: ["user.read"],
redirectUri: "https://localhost:3000/auth/server-redirect",
responseMode: "form_post",
extraQueryParameters: {
"nativebroker": "1",
}
redirectUri: "http://localhost:3000/auth/server-redirect",
responseMode: "form_post"
};

// Set request state to use hybrid spa or implicit flow
Expand Down Expand Up @@ -45,7 +42,7 @@ router.post('/server-redirect', (req, res) => {
const tokenRequest = {
code: req.body.code,
scopes: ["user.read"],
redirectUri: "https://localhost:3000/auth/server-redirect"
redirectUri: "http://localhost:3000/auth/server-redirect"
};

// Check if request is done via hybrid spa or implicit flow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
const msalInstance = new msal.PublicClientApplication({
auth: {
clientId: "{{clientId}}",
redirectUri: "https://localhost:3000/auth/client-redirect",
markmnl marked this conversation as resolved.
Show resolved Hide resolved
redirectUri: "http://localhost:3000/auth/client-redirect",
authority: "{{authority}}"
},
system: {
Expand All @@ -17,7 +17,7 @@
piiLoggingEnabled: false,
logLevel: msal.LogLevel.Verbose,
},
allowNativeBroker: true
allowNativeBroker: false
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const msalInstance = new Msal.UserAgentApplication({
auth: {
clientId: "{{clientId}}",
redirectUri: "https://localhost:3000/auth/implicit-redirect",
redirectUri: "http://localhost:3000/auth/implicit-redirect",
authority: "{{authority}}"
}
})
Expand Down
Loading