16-01-24 05:39 PM
Hello,
For the past days I've been having problems with Microsoft Authentication, the action "Get Auth Token - Username and Password" simply don't work. I received many error messages regarding access and broken TenantID etc, but only in this and Integrated Windows Auth actions.
Now I have this excception:
"MSAL.Desktop.4.42.1.0.MsalUiRequiredException:
ErrorCode: invalid_grant
Microsoft.Identity.Client.MsalUiRequiredException: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access....."
I searched in many sites but coudn't find a solution. Can somebody help me?
17-01-24 04:39 PM
Hi Luiza,
It sounds like the user you are signing in with is being asked to interactively perform multifactor authentication (entering a code or accepting a prompt on another device such as your phone) which is unsupported by Microsoft's Authentication Library that this Blue Prism object is using: https://learn.microsoft.com/en-us/entra/msal/dotnet/acquiring-tokens/desktop-mobile/username-password-authentication#constraints - the only way the Username/Password method works is if there is no multifactor authentication step for that particular user account when attempting this sort of token retrieval.
I believe the solution is either:
17-01-24 08:23 PM
Oh, I didn't realized that Client Secret was the safest option for this connection. I change my code to your option 2, but when I execute Microsoft Graph WebAPI Sharepoint stage the process breaks down. Where can I set the scp or role claim this token needs? What are this things?
17-01-24 09:23 PM
Hi Luiza,
I believe that message is related to the permissions that have been granted in your app registration within the Azure portal. Make sure you have added the permissions you want and then click the Grant admin consent to apply them.
Then when you retrieve an app token in your Blue Prism process from this app registration, it should have those permissions embedded.
18-01-24 04:23 PM
Hi, Charlie
I talked to my IT team and according to them I don't need to grant admin consent for this permissions, is this correct? I have no clue on what could be causing this problems on BP.
18-01-24 06:54 PM
For a digital worker to use a Delegated access token it is highly recommended that you have one of your IT administrations perform the admin consent. Otherwise, you will need to figure out a way to perform the user consent within your process. If you're not familiar with that, it's the process where a browser window is opened and you're prompted to grant an application to work on your behalf. You tend to see this sort of thing if you've ever granted a social media app access to other social media apps etc.
Cheers,
18-01-24 07:29 PM
Even when the admin consent is optional (set to "No") I need to grant it? I was able to perform user consent for my account, but I am not sure if the robot will be able to perform this by its own.
I am running some tests and talking w/ the IT team already, the Sharepoint API would be a really good tool for me & my team. 🙂
18-01-24 09:25 PM
Admin consent isn't required in the normal day-to-day sense because it would typically be a human user interacting with the system and being able to grant/deny the consent request via the browser. With a digital worker, it's an entirely different scenario. If you spend the time to capture the consent process using Application Modeler you could set it up such that digital workers could handle the consent request themselves, but most companies I've dealt with simply prefer to perform that admin consent via IT.
Cheers,