The Zurich release has arrived! Interested in new features and functionalities? Click here for more

"Error while authorizing the user" - Facing error while accessing Employee Centre on MS Teams

AnishGhosh
Tera Contributor

Hi All,

We are currently implementing MS Teams/Outlook integration with Servicenow. Our target is the following :

1) Servicenow Employee Centre must be available with all its facilities in MS Teams/Outlook

2) End users should be able to create MS Teams chat for particular Incidents and chat history should be available on SOW incident activities.

 

We have installed the Microsoft Integrations - Core plugin and created a manifest in SNOW. The we uploaded the manifest in admin.teams.microsoft.com . Now the Servicenow for Microsoft 365 app is available in MS Teams/Outlook. 

But the issue is that when we are trying to click on the Employee Centre tab in MS Teams we are getting the following error : Error while authorizing the user

 

I understand that this is a cred issue and the system is failing to authenticate. But how can i resolve this.

I have attached a screenshot for your reference.

Any help is appreciated.

2 ACCEPTED SOLUTIONS

Raguram1
ServiceNow Employee
ServiceNow Employee

hi @AnishGhosh 

See this article for reference to the error

 

Thanks,

Ragu

View solution in original post

Raguram1
ServiceNow Employee
ServiceNow Employee

You need to understand what is the UPN in azure end. The way this works is

Azure send UPN in the request token. We pull that information and compare with sys_user fields. OOB we have set it to email field. 

View solution in original post

13 REPLIES 13

The users are present in Teams App. Have you created any record in Connection & Credential Aliases module for Teams ? If you have can you guide me on that point?
Also one more query, while creating the manifest have you entered the Applicant ID & Tenant ID? How did you do that?

Here are few docs shared by support team:

 

 

Please follow the steps mentioned below to clean up the existing installation:

1) Clean up the existing installation:
Open the script msteams_cleanup_script and edit it with ---- var TeamProviderAppName = "<Name of the bot>";
Run the attached script in Scripts - Background. (copy, paste the content)
2) Repair the plugin - "Conversational Integration with Microsoft Teams"
3) Re-Install MS Teams from the "Messaging Apps Integration" page.
4) Navigate to Teams and initiate conversation. The bot should respond now

Please find the clean up script below:
clean up script:

// Delete Teams configuration

var TeamProviderAppName = "";

function deleteTeamsConf(TeamProviderAppName) {
if (!TeamProviderAppName)
return;

var providerApp;
var message_auth;

// Get the providerApp id
var gr = new GlideRecord('sys_cs_provider_application');
gr.addQuery('name', TeamProviderAppName);
gr.addQuery('provider', 'e177dbf3530110102f40ddeeff7b12a7');
gr.query();
if (gr.next()) {
providerApp = gr.getValue('sys_id');
message_auth = gr.getValue('message_auth');


// Delete the configuration messages
var ac = new GlideRecord('sys_cs_bot_messages');
ac.addQuery('sys_cs_provider_application', providerApp);
ac.query();
ac.deleteMultiple();
gs.info("Deleted the messages for provider app");


var inbound_message_verification;
var outbound_message_creation;

//Delete the provider auth record
var ma = new GlideRecord('message_auth');
ma.addQuery('sys_id', message_auth);
ma.query();
if (ma.next()) {
inbound_message_verification = ma.getValue('inbound_message_verification');
outbound_message_creation = ma.getValue('outbound_message_creation');

var oauth_oidc_entity;

//Delete the oidc token record
var otv = new GlideRecord('oidc_token_verification');
otv.addQuery('sys_id', inbound_message_verification);
otv.query();
if (otv.next()) {
oauth_oidc_entity = otv.getValue('oauth_oidc_entity');

//Delete profile for oauth_entity_profile
var profile = new GlideRecord('oauth_entity_profile');
profile.addQuery('oauth_entity',oauth_oidc_entity);
profile.query();
if(profile.next()){
profile.deleteRecord();
gs.info("Deleted the oidc profile entity record ");
}

//Delete profile for oauth_entity_scope
var scope = new GlideRecord('oauth_entity_scope');
scope.addQuery('oauth_entity',oauth_oidc_entity);
scope.query();
if(scope.next()){
scope.deleteRecord();
gs.info("Deleted the oidc entity scope record ");
}

//Delete the oidc entity record
var ooe = new GlideRecord('oauth_oidc_entity');
ooe.addQuery('sys_id', oauth_oidc_entity);
ooe.query();
if (ooe.next()){
ooe.deleteRecord();
gs.info("Deleted the oidc entity record " + oauth_oidc_entity );
}

otv.deleteRecord();
gs.info("Deleted the oidc token record " + inbound_message_verification );
}

//Delete the outbound token verification record
var tv = new GlideRecord('token_verification');
tv.addQuery('sys_id', outbound_message_creation);
tv.query();
if (tv.next()){
tv.deleteRecord();
gs.info("Deleted the outbound token verification record " + outbound_message_creation );
}

ma.deleteRecord();
gs.info("delete the message auth " + message_auth );
}
}
gr.deleteRecord();
gs.info("delete the provider app " + providerApp);
}

deleteTeamsConf(TeamProviderAppName);

After doing this please re install teams on your instance.

Please be informed that you need to do the configuration by your self referring to the documentation:
-->

https://www.servicenow.com/docs/bundle/xanadu-conversational-interfaces/page/administer/virtual-agen...

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1116195

https://noderegister.service-now.com/kb?id=kb_article_view&sysparm_article=KB1645090

https://www.servicenow.com/community/virtual-agent-nlu-articles/conversational-integration-with-micr...

https://www.servicenow.com/community/virtual-agent-nlu-articles/conversational-integration-with-micr...

 

while creating the manifest have you entered the Applicant ID & Tenant ID

Atul:The Application ID should match the BOT ID

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Question was not for Virtual agent, @AnishGhosh you can ignore this

Right, We are not using Virtual Agent, just OOB Employee Centre and normal chat feature