Integration

Get Involved. Join the Conversation.

Topic

    Ankur Jain
    REST service is failing with 401 Unauthorized error
    Topic posted October 15, 2019 by Ankur JainBronze Trophy: 5,000+ Points, tagged API, Connection, Integration 
    69 Views, 6 Comments
    Title:
    REST service is failing with 401 Unauthorized error
    Content:

    Hi Experts,

    Exposed a sample REST API in OIC some time back and it was working fine with Basic Authentication. But this service stopped working and throwing 401 Unauthorized error. I added a 2 step verification for the OIC user but tried to hit the REST API again but same issue. I'm able to login into OIC successfully but REST API is throwing error.

    Has some faced such issues. Please help.

     

    Comment

     

    • Monish Munot

      2 things you can check,

      1. User Role - I believe this should be ok.
      2. CORS Configuration - If you are trying to trigger from third party instance.
      • Ankur Jain
        1. User Role - I believe this should be ok.  -> No change in the user role. Have access of full OIC instance.
        2. CORS Configuration - If you are trying to trigger from third party instance. -> It's get API. Tried from browser as well as POSTMAN, but still failing.

         

    • Hemanth Lakkaraju

      Remove the 2-step verification for the user and try.

      • Ankur Jain

        Hemanth, it was failing before adding  2 step verification also

        • Hemanth Lakkaraju

          Ankur - Do you mean this is irrelevant here?

          I added a 2 step verification for the OIC user but tried to hit the REST API again but same issue

          What is the error message you see in diagnostics logs before adding 2 step verification? Are you sure the password is not expired or user is not locked? If you are able to login successfully to UI and runtime doesn't work -  Is the user SSO enabled user?

    • Mohana Gopal Selvam

      Hi Ankur,

      If SSO enabled for this user, you cant use it. It is product bug. So we have created separate user in OIC and we are using it now.

      Thanks,

      Mohan