Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
JanRV
Frequent Visitor

UserOwnsData .net 6 Application + Laravel-Vuejs webApp

I have a UserOwnsData using .Net 6.

Problem/Scenario

 

  1. The UserOwnsData will be deployed on a Debian server which is solved
    We have our own custom organization website which uses Laravel+Vuejs combo
  2. Due to X-Frame-Option of the  https://login.microsoftonline.com/ being set to "Deny" i prompted for the pop-up login which works for the iframe on the webApp code
  3. Everything works when accesing the UserOwnsData directly et. localhost:5001 and the reports shows

  4. The UserOwnsData app is shown on our web via the Iframe but upon successfull sign-in via the pop-up window

  5. Issue is that on the web client after the user signs in to microsoft and the pop-up closes.

     

This error shows on the terminal thereby not displaying the report on the web client(Full error log shown on pic)

any help is appreciated on figuring this out.


PS: sorry for not using the code block had trouble using it unable to post the codes

 

 

 

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
Microsoft.Identity.Web.MicrosoftIdentityWebChallengeUserException: IDW10502: An MsalUiRequiredException was thrown due to a challenge for the user. See https://aka.ms/ms-id-web/ca_incremental-consent.
---> MSAL.NetCore.4.19.0.0.MsalUiRequiredException:
ErrorCode: user_null

 

 

 

 

This is the part of the webApp

<template>
<Head title="Report" />

<BreezeAuthenticatedLayout>
<div class="h-screen">
<iframe :src="iframeSrc" class="h-full w-full"></iframe>
</div>
</BreezeAuthenticatedLayout>
</template>
<script>
export default {
computed: {
iframeSrc() {
return 'https://localhost:5001'; // Deployed on my local machine for development and faster debug
}
},
}
</script>

 
 
This is the Server code for the pop-up sign-in

<div class="overlay">
<div class="signin-container">
<p>Sign in to Power BI</p>
<button class="sign-in" onclick="signIn()">Sign in</button>
</div>
</div>

<script>
function signIn() {
// Open the sign-in window in a pop-up
const signInWindow = window.open("@Url.Action("Login", "Home")", "_blank", "width=600,height=600");

// Check if the pop-up window is closed every 500 milliseconds
const checkWindowClosed = setInterval(function () {
if (signInWindow && signInWindow.closed) {
clearInterval(checkWindowClosed);
console.log("Pop-up window closed");
window.location.href = "@Url.Action("Embed", "Home")";
} else {
console.log("Pop-up window still open");
}
}, 500);
}
</script>

 

 

This is a part of the HomeController code of the server that handles the pop-up login

[AllowAnonymous]
public IActionResult Login()
{
//return Challenge(new AuthenticationProperties { RedirectUri = Url.Action("ClosePopUp") });
return Challenge();
}

[AllowAnonymous]
public IActionResult ClosePopUp()
{
return Content("<script>window.close();</script>", "text/html");
}


[AllowAnonymous]
public async Task<IActionResult> Embed()
{
AuthDetails authDetails = await SignInAndGetAuthDetails();
return View(authDetails);
}

private async Task<AuthDetails> SignInAndGetAuthDetails()
{
// Generate token for the signed-in user
var accessToken = await m_tokenAcquisition.GetAccessTokenForUserAsync(Configuration["AzureAd:Scopes:0"].Split(" "));

// Get username of logged-in user
var userInfo = await m_graphServiceClient.Me.Request().GetAsync();
var userName = userInfo.DisplayName;

AuthDetails authDetails = new AuthDetails
{
UserName = userName,
AccessToken = accessToken
};

return authDetails;
}

 

UserOwnsData Successfully displayed on web app

Step 1.png

Did not include the pop-up due to accounts being shown but this is the part where the user has successfully login and the pop-up closes which shows error 500 which means error on the UserOwnsData

step2.png

This is the full error log

step 3.png

1 REPLY 1
Anonymous
Not applicable

Hi @JanRV,

>>IDW10502: An MsalUiRequiredException was thrown due to a challenge for the user.

This error messages seems need to provide additional authentication information to complete the request.

For this scenario, I'd like to suggest you check the authentication parts of the requests and try to sign in again with vailed authentications.

In addition, please also check the accounts if they are still active and ensure they have enough permissions to access the resource.
Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.