MS Teams authorization failing with: "Failed to generate authorization link"

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Problem

When trying to authorize the connection between Jira and MS Teams it fails with:

"Failed to generate authorization link. Please contact your Jira Server administrator and confirm Application link for Microsoft Teams app has been properly configured."


Diagnosis

Diagnostic Steps

  • Navigate to Administration > System > Logging and profiling
  • Scroll up and go to the "Mark Logs" section above
  • At the "Optional Message" field insert MSTeams starts here
  • Under HTTP Access Logging, click in Enable the HTTP access log, also click on Enable the HTTP dump log
  • Under "Default Loggers" section, click on Configure logging level for another package
  • At the "Package name" field, enable TRACE for the following packages:
org.apache.http
com.microsoft.teams


On the trace you will see:

2023-08-04 09:39:19,297-0400 RxCachedThreadScheduler-1 DEBUG AGUDIPEL 727x2292114x6 1hbs75q 10.137.206.28,10.190.64.13 /rest/plugins/1.0/available/featured [c.m.teams.utils.ExceptionHelpers] getAndAuthorizeTemporaryTokenWithUrl error com.google.api.client.http.HttpResponseException: 401 
    POST https://jira.cablevision.com/plugins/servlet/oauth/request-token
    oauth_problem=consumer_key_unknown
    ROOT CAUSE: HttpResponseException: 401 
    POST https://jira.cablevision.com/plugins/servlet/oauth/request-token
    oauth_problem=consumer_key_unknown
    EXCEPTION STACK TRACE: com.google.api.client.http.HttpResponseException: 401 
    POST https://jira.cablevision.com/plugins/servlet/oauth/request-token
    oauth_problem=consumer_key_unknown
        at com.google.api.client.http.HttpResponseException$Builder.build(HttpResponseException.java:293)

Cause

This is caused by incorrect Application Link Type. MS Team uses OAuth 1.0, so when creating the Application Link you need to select Application Type "Atlassian Products", that uses OAuth 1.0.

Resolution

Recreate the Application Link, selecting Application Type "Atlassian Products":


Last modified on Aug 17, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.