microsoft / microsoft/30daysof

Error npx port auto(8080) different from redirect URI port.

Open
#157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
183
Forks
62
Avg merge
17h 14m
Merged PRs (30d)
1

Description

Error npx port auto(8080) different from redirect URI port.

In case someone gets the same thing that happens to me 😊.
In my case npx http-server assign a different port than 8080 sometimes 8081/8082 depending on the ports it has busy. This causes it to redirect to another service after getting the token and throwing an error.

Error scenario

Service up on 8081
DiferentPortNpx

Error when redirecting
Error8080

My solution

Manually assign a port that is free.

  1. Modify package.json.
    PackageMod

  2. Modify redirection aad.portal.azure configuration.
    SpaaadappMod

  3. Modify redirectUri in archive auth.js.
    AuthjsMod

Raise the service again and it worked :P
200OK

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing package.json and auth.js, then compare their redirect-port settings with the redirect URI configured in the Azure portal. Reproduce the flow with npx http-server while port 8080 is unavailable; it is done when the running service's port matches the configured redirect URI and authentication completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, javascript
Domain
authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.