Uploaded image for project: 'Elements Connect'
  1. Elements Connect
  2. CO-3655

Error 500 when configuring a OAuth datasource to Microsoft Sharepoint (Azure)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 5.13.1, 6.0.1
    • Fix Version/s: 6.1.4
    • Labels:
      None
    • Functional components:
      Datasource - Jira REST

      Description

      How to reproduce

      1. As a Microsoft Azure admin, from "Azure Active Directory configuration":
        1. Create a new "App registration"
        2. Give it a meaningful name (i.e.: "Elements Connect" or "Jira")
        3. Set the redirect URI to "https://SERVER/nfeed/admin/models/datasources/oauth/_callback" - where "SERVER" is your Jira instance base URL
        4. Click on "Register"
        5. Add a client secret
          1. name: "Elements Connect"
          2. Expires: "Never"
      2. From Jira, as a Jira admin
        1. Create a new URL datasource
        2. Authentication mode: "OAuth"
        3. OAuth settings:
          1. Client ID: the App registration Application (client) ID, from the "Overview" section
          2. Client Secret: the client secret you have created at step 1.5
          3. Authorise URL: https://login.microsoftonline.com/common/oauth2/authorize
          4. Token URL: https://login.microsoftonline.com/common/oauth2/token
          5. Scopes: http://sharepoint/content/sitecollection/web/list
        4. Click on "Get new credential"
        5. You're redirect to Azure login screen: log in
        6. Approve the connection

      Current

      You're redirected to /nfeed/admin/models/datasources/oauth/_callback?code=YYYYYY&session_state=XXXXXXX

      An error message is displayed:

      java.lang.IllegalArgumentException: key expires_in at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:880) at com.google.api.client.json.JsonParser.parse(JsonParser.java:381) at com.google.api.client.json.JsonParser.parse(JsonParser.java:354) at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:87) at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:81) at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:459) at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307) at com.valiantys.jira.plugins.sql.service.request.execution.datasource.oauth.OAuthService.validateAuthorizationCode(OAuthService.java:134) at com.valiantys.jira.plugins.sql.admin.rest.v2.api.DatasourcesOauthRestService.oAuthCallback(DatasourcesOauthRestService.java:223) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:192) at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:83) at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:53) at com.atlassian.plugins.rest.common.expand.interceptor.ExpandInterceptor.intercept(ExpandInterceptor.java:34) at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:53) at
      

      Expected

      OAuth authentication works
       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mickael.conde@valiantys.com Mickael Conde (Inactive)
              Reporter:
              christophe.prome@valiantys.com Christophe Promé
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: