Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Development
  1. OpenProject
  2. Forums
  3. Development
  4. Authentication Error in API V3

Authentication Error in API V3

Added by Leonardo D Silva over 5 years ago

I am facing a persistent problem trying to authenticate to api through a C # application.

I am using RestClient.Authenticator = new HttpBasicAuthenticator (username, password) to authenticate the user and access the services, but always give me the following message:

{"_type":"Error","errorIdentifier":"urn:openproject-org:api:v3:errors:Unauthenticated","message":"Você não forneceu as credenciais corretas."}

*VISUAL STUDIO*

This is C# code:

public void OpenCall()
{
    SetParameters();

    _restRequest.Parameters.Clear();

    _restClient.BaseUrl = new Uri(StringUri);
    _restRequest.AddHeader("Content-type", "application/json");
    _restClient.Authenticator = new HttpBasicAuthenticator(Auth[0].Trim().ToLower(), Auth[1].Trim().ToLower());
    _restRequest.Resource = "/api/v3";
    _restRequest.RequestFormat = DataFormat.Json;

    var result = _restClient.Get<object>(_restRequest);
}

In the browser my credentials work normally. I have also tried token access, and it doesn't work.

In Postman the message you receive is this:

*TESTE POSTMAN*

*The server couldn't send a response:* Ensure that the backend is working properly

*Self-signed SSL certificates are being blocked:* Fix this by turning off 'SSL certificate verification' in Settings > General

*Proxy configured incorrectly:* Ensure that proxy is configured correctly in Settings > Proxy

*Request timeout:* Change request timeout in Settings > General


Loading...