Uploaded image for project: 'Identity'
  1. Identity
  2. ID-6270

Cannot call JIRA's session endpoint (/rest/auth/1/session) with email address (Atlassian ID) instead of username

    XMLWordPrintable

Details

    Description

      Summary

      Using the Atlassian ID instead of the username to call the /rest/auth/1/session endpoint returns either error 401 or error 500

      Steps to Reproduce

      1. Send a request to /rest/auth/1/session endpoint having body {"username":"USERNAME", "password":"********" }. See that this works correctly
      2. Send another request using the Atlassian ID instead of the username: {"username":"EMAIL_ADDRESS", "password":"********" }

      Expected Results

      You get the session id

      Actual Results

      Error 401 or 500 is returned instead.

      The below exception is thrown in the logs:

      2017-02-10 13:36:50,136 http-nio-3000-exec-2 ERROR admin 816x1233x1  89.228.128.139 /rest/auth/1/session [c.a.j.rest.exception.ExceptionInterceptor] Returning internal server error in response
      java.lang.reflect.InvocationTargetException
            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)
            ...
      ...
      Caused by: java.lang.NullPointerException
            at com.atlassian.jira.rest.auth.LoginInfo.<init>(LoginInfo.java:27)
            at com.atlassian.jira.rest.auth.Login.login(Login.java:128)
            ... 290 more
      

      Workaround

      Send the username in the request body instead of the email address.

      Attachments

        Issue Links

          Activity

            People

              dbonotto Dario B
              dbonotto Dario B
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: