02-01-24 01:24 PM
Hello -
I am trying to use this VBO to access users in our Azure AD, but am getting the following message :
Internal : Unexpected error Error during Web API HTTP Request
HTTP Status Code: 401
HTTP Response Content: {"error":{"code":"InvalidAuthenticationToken","message":"CompactToken parsing failed with error code: 80049217","innerError"
I have a valid Token and have set up the API Permissisons Azure side ok; well least I think - but guide does not mirror the API perismisons I have in Azure, think they may have changed since publication)
(I am succesfully using the Graph Excel/Outlook VBO and have followed the same pricniples when setting this API up)
Many Thanks
Thanks
Answered! Go to Answer.
17-01-24 10:06 PM
Hi @dannyhay73,
In your screenshots you show that you have defined authentication within the Microsoft Graph - Users service definition. That's the old way of doing it. The current connector doesn't use that method. The Common Authentication section should be set to None and there should be a Common Header defined as Authorization with a value of Bearer [Access Token] where [Access Token] is defined as a Text input in the Common Parameters section. Have you tested it that way? If so, and you're still having issues my guess is that there's a problem with the Scope definition of the token.
Cheers,
02-01-24 05:10 PM
HI Danny Hay,
Looks like this VBO has issue communicating based on the comments from the digital exchange.
Assuming you are using the latest authentication VBO(https://digitalexchange.blueprism.com/dx/entry/9648/solution/microsoft-graph-api---authentication)?
https://digitalexchange.blueprism.com/dx/entry/3439/solution/connector-for-microsoft-graph-api---users-interface
adding @ewilson
03-01-24 09:12 AM
Thanks Harish, @ewilson, any ideas? - Many Thanks
03-01-24 03:40 PM
How are you generating your token? Are you using the MSAL VBO or a different method?
Cheers,
03-01-24 05:43 PM
Hi Eric,
I have tried two methods
Using the MSAL.Net VBO to Autheticate and generate a Token (which we succefully use with Graph Excel & Graph Outlook) and using that Token in the Users - 1.1.0 VBO
and
The Web API Method as described in the documenation supplied with the Users - 1.1.0 VBO,
- be it I do not know how this generates a Token (I have tried without exposing the credential to the process aswell)
Many Thanks
My other consideration is the API Credentials :
15-01-24 02:15 PM
Hi @ewilson, any further thoughts ? - Many Thanks
16-01-24 02:06 PM
Hi @dannyhay73,
Apologies for the delay. The Microsoft Graph - Users connector is actually defined as a Web API Service in Blue Prism, so it's slightly different in terms of how it's defined than a regular VBO. However, to work with it you should be able to follow the same general process as you do with the Graph Excel and Graph Outlook VBOs. Simply use the MSAL.NET VBO to generate a specific token and then pass that token into the actions on the Users connector via the Access Token input parameter.
Cheers,
17-01-24 08:59 AM
Thanks Eric - I had done that (prev screen shots) and did get a valid token to pass to the process, but still got the token error. Thanks
17-01-24 10:06 PM
Hi @dannyhay73,
In your screenshots you show that you have defined authentication within the Microsoft Graph - Users service definition. That's the old way of doing it. The current connector doesn't use that method. The Common Authentication section should be set to None and there should be a Common Header defined as Authorization with a value of Bearer [Access Token] where [Access Token] is defined as a Text input in the Common Parameters section. Have you tested it that way? If so, and you're still having issues my guess is that there's a problem with the Scope definition of the token.
Cheers,
18-01-24 05:37 PM
Fantastic @ewilson, that was the missing part of the jigsaw and the token issue is now resolved; thank you for all your help