User not authorized error when connecting MS Teams to Jira

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Problem

  1. During the authorization process within MS teams, after putting in the Jira ID and clicking connect, the authorization button is greyed out and a "User not authorized" message appears at the bottom of the pop-up.

  2. The following appears in the atlassian-jira.log

1 2021-09-24 10:41:25,718-0700 OkHttp https://msteams-jira-server.service.signalr.net/... ERROR user@example.com 602x439492x1 1lpl1qn 1.2.3.4 /plugins/servlet/signalr/reconnect [c.m.teams.service.MessageService] Invalid JWT token

Diagnosis

Diagnostic Steps

  • Enable DEBUG logging for com.microsoft.teams.utils and look for an error such as this in atlassian-jira.log.

    1 [c.m.teams.utils.ExceptionHelpers] RestOperations hasValidSignature org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://login.microsoftonline.com/organizations/discovery/v2.0/keys": PKIX path building failed:

Cause

This is caused by an invalid certificate path for the "https://login.microsoftonline.com/organizations/discovery/v2.0/keys" endpoint, often due to use of a self-signed certificate or a proxy.

Solution

Resolution

Utilize the instructions in the Unable to connect to SSL services due to "PKIX Path Building Failed" error article to troubleshoot and fix the issue.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.