Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-9336

[fiware-stackoverflow] How to programmatically authenticate to HDFS in fiware cosmos

    Details

      Description

      Created question in FIWARE Q/A platform on 20-06-2015 at 01:06
      Please, ANSWER this question AT https://stackoverflow.com/questions/30948711/how-to-programmatically-authenticate-to-hdfs-in-fiware-cosmos

      Question:
      How to programmatically authenticate to HDFS in fiware cosmos

      Description:
      I'm writing a .net application with C# to programmatically run REST apis against hdfs on fiware but on http POST operations it fails with 401 (access denied). it works for simple GET operations but I'm not sure how to do authentication. From the spec it seems SPEGNA and delegated auth tokens are two options but how do i do this programmatically? I only have my user name and password to go off of. I'm using the RestSharp library to make rest interactions easier.

      This code works

      var client = new RestClient("http://cosmos.lab.fi-ware.org:14000");
      request = new RestRequest("webhdfs/v1/user/<userID>");
      request.AddParameter("op", "LISTSTATUS");
      request.AddParameter("user.name", "<userID>");
      IRestResponse response = client.Execute(request);
      var content = response.Content; // raw content as string

      this code fails with http 401

      var client = new RestClient("http://cosmos.lab.fi-ware.org:14000");
      var request = new RestRequest("webhdfs/v1/user/<userID>/structured_data123.txt",Method.PUT);
      request.AddParameter("op", "CREATE");
      request.AddParameter("user.name", "<userID>");
      IRestResponse response = client.Execute(request);

      HTTP Status 401 - org.apache.hadoop.security.authentication.client.AuthenticationException: Anonymous requests are disallowed

      Thoughts? ideas? thank you in advance!

        Activity

        backlogmanager Backlog Manager created issue -
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-30 03:05|CREATED monitor | # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-30 03:05|CREATED monitor | # answers= 1, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-30 06:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-30 06:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-30 09:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-30 09:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        fla Fernando Lopez made changes -
        Assignee Francisco Romero [ frb ]
        fla Fernando Lopez made changes -
        HD-Enabler Cosmos [ 10872 ]
        Description
        Created question in FIWARE Q/A platform on 20-06-2015 at 01:06
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/30948711/how-to-programmatically-authenticate-to-hdfs-in-fiware-cosmos


        +Question:+
        How to programmatically authenticate to HDFS in fiware cosmos

        +Description:+
        I'm writing a .net application with C# to programmatically run REST apis against hdfs on fiware but on http POST operations it fails with 401 (access denied). it works for simple GET operations but I'm not sure how to do authentication. From the spec it seems SPEGNA and delegated auth tokens are two options but how do i do this programmatically? I only have my user name and password to go off of. I'm using the RestSharp library to make rest interactions easier.

        This code works

        var client = new RestClient("http://cosmos.lab.fi-ware.org:14000");
        request = new RestRequest("webhdfs/v1/user/&lt;userID&gt;");
        request.AddParameter("op", "LISTSTATUS");
        request.AddParameter("user.name", "&lt;userID&gt;");
        IRestResponse response = client.Execute(request);
        var content = response.Content; // raw content as string


        this code fails with http 401

        var client = new RestClient("http://cosmos.lab.fi-ware.org:14000");
        var request = new RestRequest("webhdfs/v1/user/&lt;userID&gt;/structured_data123.txt",Method.PUT);
        request.AddParameter("op", "CREATE");
        request.AddParameter("user.name", "&lt;userID&gt;");
        IRestResponse response = client.Execute(request);


        HTTP Status 401 - org.apache.hadoop.security.authentication.client.AuthenticationException: Anonymous requests are disallowed

        Thoughts? ideas? thank you in advance!
        Created question in FIWARE Q/A platform on 20-06-2015 at 01:06
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/30948711/how-to-programmatically-authenticate-to-hdfs-in-fiware-cosmos


        +Question:+
        How to programmatically authenticate to HDFS in fiware cosmos

        +Description:+
        I'm writing a .net application with C# to programmatically run REST apis against hdfs on fiware but on http POST operations it fails with 401 (access denied). it works for simple GET operations but I'm not sure how to do authentication. From the spec it seems SPEGNA and delegated auth tokens are two options but how do i do this programmatically? I only have my user name and password to go off of. I'm using the RestSharp library to make rest interactions easier.

        This code works

        var client = new RestClient("http://cosmos.lab.fi-ware.org:14000");
        request = new RestRequest("webhdfs/v1/user/&lt;userID&gt;");
        request.AddParameter("op", "LISTSTATUS");
        request.AddParameter("user.name", "&lt;userID&gt;");
        IRestResponse response = client.Execute(request);
        var content = response.Content; // raw content as string


        this code fails with http 401

        var client = new RestClient("http://cosmos.lab.fi-ware.org:14000");
        var request = new RestRequest("webhdfs/v1/user/&lt;userID&gt;/structured_data123.txt",Method.PUT);
        request.AddParameter("op", "CREATE");
        request.AddParameter("user.name", "&lt;userID&gt;");
        IRestResponse response = client.Execute(request);


        HTTP Status 401 - org.apache.hadoop.security.authentication.client.AuthenticationException: Anonymous requests are disallowed

        Thoughts? ideas? thank you in advance!
        HD-Chapter Data [ 10838 ]
        fla Fernando Lopez made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        3h 1 Backlog Manager 30/May/17 6:04 AM
        In Progress In Progress Answered Answered
        2h 59m 1 Backlog Manager 30/May/17 9:04 AM
        Answered Answered Closed Closed
        46m 29s 1 Fernando Lopez 30/May/17 9:50 AM

          People

          • Assignee:
            frb Francisco Romero
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: