EA consent: `prompt=consent` forces "Need admin approval" in tenants where an admin already granted consent
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- authentication
Research direction
Start with EaGraphAuth.cs and EaConsentController.cs, then review the existing consent-flow behavior and tests around BuildConsentUrl and Callback. Add tests for the four listed outcomes, including logging error_description, and verify redirects distinguish connected from failed; the URL builder should no longer include a prompt= parameter.
Written by the indexing model from the issue text.
Description
Repository and prior art
- The defect is in
memex/Memex.Portal.Shared/Authentication/EaGraphAuth.csandEaConsentController.cs. Both files are in MeshWeaver core. - Pull request #2101 made
/auth/ea/connectskip consent for a connected user. It keptprompt=consentfor the first connect. - No issue covers the admin-consent case. Searched across Systemorph repositories for
prompt=consent,auth/ea/connectandEA consent callback.
What happens
On a customer instance, a member of the customer's Entra tenant opens /auth/ea/connect:
- Microsoft shows "request access" (admin approval).
- The tenant admin approves the request.
- The user retries, and Microsoft shows "request access" again.
Cause
EaGraphAuth.BuildConsentUrl appends &prompt=consent (EaGraphAuth.cs:142). This forces the consent dialog on every authorize request. In a tenant where users may not consent to these scopes, the forced dialog always becomes an admin-approval request. This also happens after an admin granted tenant-wide consent.
Evidence: on 2026-10-02, prompt=consent was removed by hand from the authorize URL. Microsoft then skipped the approval page and redirected back to the portal.
Second defect: the callback hides its outcome
EaConsentController.Callback redirects to the return URL in every case: success, Microsoft error and failed code exchange. The browser shows no result. The log line keeps error but drops error_description. Diagnosis on the instance therefore needed the portal logs.
Proposed change
- Remove
&prompt=consentfromBuildConsentUrl. Microsoft still prompts when consent is missing (incremental consent).?force=truestill runs the authorize flow and stores a new grant. - Log
error_descriptionin the callback. - Report the outcome on the return URL:
eaConnect=connected, oreaConnect=failed&reason=<class>. - Update the comments that name
prompt=consent(EaConsentController.cs:92,EaGraphAuth.cs:136).
Tests (write first)
BuildConsentUrlcontains noprompt=parameter.- A callback with
errorredirects witheaConnect=failedand logserror_description. - A callback whose code exchange fails redirects with
eaConnect=failed. - A callback whose code exchange succeeds redirects with
eaConnect=connected.
Severity sev:H: members of a tenant that restricts user consent cannot connect the EA at all.
- Dominant language
- C#
- Stars
- 12
- Forks
- 5
- Avg merge
- 6h 30m
- Merged PRs (30d)
- 960
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Systemorph/MeshWeaver
-
bug ci-failure sev:H
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Systemorph/MeshWeaver#7549 ·
Maintainers usually reply within 1 day
-
bug sev:M
Difficulty 5/5 Over a week Newbie friendliness 25/100
Systemorph/MeshWeaver#7548 ·
Maintainers usually reply within 1 day
-
bug sev:M
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Systemorph/MeshWeaver#7542 · 3 comments ·
Maintainers usually reply within 1 day
-
area:hosting enhancement feature:registry-retention sev:M
Difficulty 5/5 Over a week Newbie friendliness 20/100
Systemorph/MeshWeaver#7530 ·
Maintainers usually reply within 1 day
-
bug sev:L
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Systemorph/MeshWeaver#7497 · 2 comments ·
Maintainers usually reply within 1 day
All issues in Systemorph/MeshWeaver
Similar issues
-
bug 優先: 低
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
.NET area: storage bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Larson-Logan/medal-sync#61 ·
Maintainers usually reply within 1 day
-
area-ai bug untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
dotnet/extensions#7893 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100