401 - Unauthorized error with an API call when using the OKR for Jira app

401 - Unauthorized error with an API call when using the OKR for Jira app

This article helps with 401 Unauthorized errors when a user makes an API call when using the OKR for Jira App. Listed below are a few reasons why a user might experience this error:

  1. Missing authentication credentials The most common reason for getting a 401 error is incorrect or missing authentication credentials. Please provide the correct username and password or API-Token in your request.

    A wrong API-Token was passed.

     

  2. Expired authentication credentials: If your authentication token has expired, you will get a 401 Unauthorized error. Ensure you have obtained a new token or refreshed your token before making the request.

  3. Incorrect endpoint or URL: Ensure you send the request to the correct endpoint or URL. If the endpoint is incorrect, you may receive a 401 error.

    A wrong domain is given from a wrong location.
  4. Insufficient privileges: If you are trying to access a resource that requires higher privileges than your current user has, you may get a 401 Unauthorized error. Check that your user account has the necessary permissions to access the resource.

Make sure to check the above to solve the problem with an Unauthorized error.

 

One of the rare cases is an API call, which causes a 401 error, is the below use cases.

  1. If anyone from the European Union tries to access: https://okr-for-jira-prod.herokuapp.com/, the users will face the 401 unauthorized error.

  2. And if anyone other than the European Union tries to access: https://okr-for-jira-prod-eu.herokuapp.com, the users will face the 401 unauthorized error.

If you are in the EU region, make sure to use the host as: https://okr-for-jira-prod-eu.herokuapp.com

Everywhere else it is: https://okr-for-jira-prod.herokuapp.com

For example, if a user is based in the non-EU region and accesses this API https://okr-for-jira-prod-eu.herokuapp.com, then the user might receive a 401 Unauthorized error. See the below screenshot.

 

If the same user access this API https://okr-for-jira-prod.herokuapp.com, the call will succeed. See the below screenshot.

 

Comments