Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6989969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:17:02+00:00 2026-05-27T19:17:02+00:00

I want to implement a REST-api in C#. I found that WCF Webapi can

  • 0

I want to implement a REST-api in C#. I found that WCF Webapi can do that.
My first question is how I can give only authenticated users access to my api?
And the second question is if the client to be authenticated is a Android-device, how do I do the HTTP request to authenticate?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:17:03+00:00Added an answer on May 27, 2026 at 7:17 pm

    em…
    We did similar things, we use basic authentication+HTTPS,
    that means the user name and password will be passed along each request, in the http header.

    Thus in your web service, you can authenticate then, if it is from not valid user, then kick them out.

    Or alternatively you can generate a GUID for each of your client, ask then to pass the GUID back to the search along with each http request, authenticate the GUID.

    on Android device , when you send out the http request , add an http header

    Authorization:Basic ****

    quite easy , here is a codesnipet on android

        String baseUrl = this.getValue(ServiceBaseUrlKey);</i>
        DefaultHttpClient client = new ConnectionManager().getHttpClient();//create a httpclient
        HttpGet request = new HttpGet();
        request.setURI(new URI(baseUrl + "Path"));
        //TODO need to wrap up how to apply the basic authentication.
        UsernamePasswordCredentials credentials =  new UsernamePasswordCredentials("UserName", "****");
        request.addHeader(new BasicScheme().authenticate(credentials, request));   
        request.addHeader("Content-Type","Application/JSON");
        HttpResponse response =  client.execute(request);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Microsoft has announce that WindowsLiveID become a OpenID provider . I want implement it
I want to implement a two-pass cache system: The first pass generates a PHP
I would like to implement a API of JavaScript that sort of resemble a
I'm building a REST API that exposes data as XML. I've got a whole
We are currently using Spring MVC to implement REST web services. We now want
We are trying to implement a REST API for an application we have now.
I intend to implement a pure Akka powered REST based Web API. I am
I'm developing a REST api, and I'm wondering the following: I want to use
I have a custom auth provider working against a REST API and now want
I want to know how I could implement REST in my web application. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.