azure b2c - an exception has occurred - azure

I am trying to set up resource owner password credentials flow in Azure AD B2C using https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-ropc
I followed the instructions on the page closely. When I try and log in using Postman, I get the error "AADB2C: An exception has occurred." There seems to be no way of seeing the details of the error, and the standard Azure audit logs are empty.
How do you find the details of these errors?
I have seen that you can configure application insights, but that requires a custom profile (which may be my only option)
Edit - I got it to work, turns out I had the wrong flow policy selected - so if you get this please make sure to triple check it! I would still consider this a bug or poor user experience though as there should be a way to actually debug the error yourself without having to contact Microsoft.

Read some awesome documentation about Azure AD B2C here. Then make sure you download Gaining Expertise with Azure AD B2C.
Check this section: Test and Debug a Custom Policy by Using Application Insights.
I'll paste the content here just in case:
You can use the detailed log information provided by Application
Insights to investigate any issues that might occur with a custom
policy. Use the following steps to configure IEF to send events
directly to Application Insights.
Using Visual Studio, open the SignUpOrSignIn.xml file.
Add the following attribute to the <TrustFrameworkPolicy> element.
DeploymentMode="Development" UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights"
Under the <RelyingParty> element, add the following <UserJourneyBehaviours> node immediately after <DefaultUserJourney ReferenceId="SignUpOrSignIn" /> element. Replace the bold text with your application Insight Key.
<UserJourneyBehaviors>
<JourneyInsights TelemetryEngine="ApplicationInsights" InstrumentationKey="Your Application Insight Instrumentation Key" DeveloperMode="true" ClientEnabled="false" ServerEnabled="true" TelemetryVersion="1.0.0" />
</UserJourneyBehaviors>
Note the following points:
DeveloperMode=true is good for development but constrained at high volumes because it tells Application Insights to expedite the telemetry through the processing pipeline.
ClientEnabled="true" will send client-side scripts to Application Insights, for tracking page view and client-side errors
ServerEnabled="true" will send the existing UserJourneyRecorder JSON as a custom event to Application Insights
...
Save the file.
Return to the Azure Portal and switch to your B2C tenant. Open the Azure AD B2C Blade and select Identity Experience Framework.
Select Upload policy and upload the SignUpOrSignIn.xml policy file. Select overwrite the policy if it exists.
Check the logs in Application Insights
Select the B2C_1A_signup_signin policy.
Select Run now.
Attempt to sign in as:
an invalid user (type a random email address). T
TestUser#AwesomeYourLastname.onmicrosoft.com but with the wrong password.
TestUser#AwesomeYourLastname.onmicrosoft.com using the correct password.
In the Azure portal, switch back to your Azure tenant, and open the DemoInsightsForCustomPolicies Application Insights resource.
In the Details/Overview menu, select Analytics.
Open a new tab inside the Application Insights web application.
Use any of the following example queries to view log information.
traces: See all of the logs generated by Azure AD B2C
traces | where timestamp > ago(1d): See all of the logs generated by Azure AD B2C for the last day
traces | count: See how many events have been generated
traces | render pie chart: Summarize the data as a pie chart
Note that you might have to wait for a few minutes before logs start appearing in Application Insights.
If necessary, you can download the query results and export them to CSV files if you need to perform a detailed analysis.
You can learn more about performing analytics with Application Insights here.
#######
Following these steps I was able to see the real exception message returned by B2C when executing a custom Password Reset policy. See below:

I tried this, it worked well. The following is my tried in the postman:

Related

Azure B2C User Attributes Claim - Unable to Save Claim?

I'm using Azure B2C. I have a custom claim I want include on profile edit. This is the built in user flow for Profile Edit (B2C_1_ProfileEdit).
I go to Application claims, select my claim, and click Save I get an error message
"Unexpected error, please try again later"
No details were given in the error message.
What could this be? I'm not sure where to look to debug it? Any ideas?
I was about to create a support ticket with Microsoft today. Before I did that, I tried to update it again and it worked this time. Must have been an Azure problem !

Application select greyed out. Azure AD B2C - Identity experience framework

I was simply following this guide:
Get started with custom policies in Azure Active Directory B2C
Following all the previous instructiones without a problem. I got to "Test the custom policy" where I got stuck. When I open any of my custom policies it is a same story. Application select and select reply url is greyed out.
Any idea what might cause it?
Sreenshot of my problem:
Image
Please create a B2C application registration.And you can refer to this doc.

Azure Application Insight Work items authorization error

My purpose is to create bug in Azure DevOps directly from Azure Application Insight, I am doing to attach the work item (bug) feature available in Azure Application Insight but on clicking Authorize button it give me following error
Authorization token provided through OAuth does not have access to read/write work items for requested uri/project collection/project
for reference please find the below image.
Updates:
I didnt understand what you meant by private browser, and I have full admin access over Azure Portal.
basically I have the https://dev.azure.com/HealthTechnologies/ReportItNow link in which
https://dev.azure.com is the devop url
HealthTechnologies is the organization
ReportItNow is the Project
so in Azure insight workitem section, URL I am putting https://dev.azure.com/HealthTechnologies/ and in project I am putting ReportItNow, I dont know what i am doing wrong.
Still waiting for this glitch to solve.
Oky let me make it more simple, if I want to automatically create bug in Azure DevOps when ever any new exception came in to the Azure
Application Insight How I can get this into real practical.
I solve this when I took a detailed look at the error message url. It's saying that the missing authorization is for https://uri/Project Collection/Project. Based on that, I changed my url from https://dev.azure.com/organization to https://dev.azure.com/ and it worked,

Getting Error while doing Sign In using custom policy in Azure Active Directory B2C

I am struggling at the Sign-In functionality of an existing user in Azure Active Directory B2C. I had followed this link for implementing the custom claims in JWT token using custom policies. After modifying the TrustFrameworkBase.xml, TrustFrameworkExtensions.xml & SignUpOrSignin.xml file as per my need by following the same link, I uploaded those files on azure and was trying to run user flow from the azure. Now the issue I am facing currently is that Sign-In functionality is not working. It is giving me the error Unable to validate the information provided. (See the screenshot attached)
Don't know where I am doing wrong.
Any help in this regard would be really helpful.
Update: After adding the Application Insights in my SignUpOrSignIn.xml file, Now I am able to get the exact error i.e The claim type "objectId", designated as the identifier claim type, could not be found in the claims collection for the claims principal in tenant id "B2C_1A_signup_signin".
But don't know at which step I am missing it or how to modify the policy to run it successfully.
After struggling to find the solution of the problem mentioned from 3 days, finally I was able to solve the problem.
I removed the tag
<ValidationTechnicalProfile ReferenceId="AAD-UserWriteProfileUsingObjectId" /> mentioned under Technical Profile tag with Id SelfAsserted-LocalAccountSignin-Email in TrustFrameworkBase.xml file. Now I am able to subsequently sign in using ADB2C.

Azure new users: You do not have permission to view this directory or page

I have a web app in Azure. The access to that web app is controlled by Azure Active Directory. The app is up and running since September of last year. I didn't make any changes to the app for a while and have 33 users in that app.
So, a week ago I tried to add a user, using the same methods and paths I used before.
The new user can log in to microsoft (portal.office.com). After the initial log in and changing of the password the user goes to the web app in Azure and get the following error: You do not have permission to view this directory or page.
Error tracing gives me this:
HTTP Error 401.73 - Unauthorized You do not have permission to view
this directory or page.
Most likely causes: The authenticated user does not have access to a
resource needed to process the request.
Things you can try: Create a tracing rule to track failed requests for
this HTTP status code. For more information about creating a tracing
rule for failed requests, click here.
Detailed Error Information: Module EasyAuthModule_32bit
Notification BeginRequest Handler
ExtensionlessUrlHandler-Integrated-4.0 Error Code 0x80004005
Requested URL https://*******:80/.auth/login/aad/callback Physical
Path D:\home\site\wwwroot.auth\login\aad\callback Logon Method
Not yet determined Logon User Not yet determined
More Information: This is the generic Access Denied error returned by
IIS. Typically, there is a substatus code associated with this error
that describes why the server denied the request. Check the IIS Log
file to determine whether a substatus code is associated with this
failure. View more information ยป
Microsoft Knowledge Base Articles:
Another observed behavior: usually when new users are logging in the web app asks for permissions for the AD to access their account information. Ever since this problem came up this is not the case any more.
Other users do not have any problems logging in. This problem only happens with new users who never logged in before.
EDIT: When I go to Active Directory and look at sign ins, I see failures to log into the web app with sign-in error code 90092. Failure Reason: Other.
Microsoft help desk could not give me details on that error code.
Checkout the related question and answer here. All new users have to first consent the application (agree and give your application permissions to access their profile / or you indicated as required permissions).
In short, you have to design "sign-up" button for your application, which uses the "login_url" and appends "&prompt=consent" to the query string.
Read all related resources here to better understand the consent framework.
And please read the documentation about Azure App Service Authentication/Authorization here, as well as the Azure AD specific documentation here.
OMG, I just found an answer. I created a test app and set it up to mirror the settings of my live app.
In Required Permissions the new app had nothing for Microsoft Graph, the live app had 5 permissions. I deleted Microsoft Graph and it works now!
I wish Microsoft communicated better about discontinued API's. I did get an alert, but it was mostly talking about MS Office 365.

Resources