http-authentication

Getting JSON data from a website using Delphi [closed]

我们两清 提交于 2019-11-30 16:42:45
There is this website http://www.ingress.com/intel To access the website, we must login using username and password. Once accessed, the site uses JSON for its data. I am new to this JSON thing. Anyone can give a general example how to get JSON data from a website using Delphi? I am using Delphi 7 by the way. Thanks. Those are two questions. how to get file from HTTP server how to parse JSON string For 1st question there are a lot of libraries, some of those: Internet Direct aka Indy Sockets (distributed with Delphi and http://www.indyproject.org/ ) Internet Components Suite aka ICS http://www

Getting JSON data from a website using Delphi [closed]

五迷三道 提交于 2019-11-30 16:19:45
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . There is this website http://www.ingress.com/intel To access the website, we must login using username and password. Once accessed, the site uses JSON for its data. I am new to this JSON thing. Anyone can give a

How can I send HTTP Basic Authentication headers in Android?

℡╲_俬逩灬. 提交于 2019-11-30 08:50:44
问题 I am not sure how to send HTTP Auth headers. I have the following HttpClient to get requests, but not sure how I can send requests? public class RestClient extends AsyncTask<String, Void, JSONObject> { private String convertStreamToString(InputStream is) { /* * To convert the InputStream to String we use the * BufferedReader.readLine() method. We iterate until the * BufferedReader return null which means there's no more data to * read. Each line will appended to a StringBuilder and returned

How can I use Basic HTTP Authentication in PHP?

假装没事ソ 提交于 2019-11-30 08:40:06
I'm trying to use Basic HTTP Authentication and followed the example on the PHP manual page. But it doesn't work for me. The variable $_SERVER['PHP_AUTH_USER'] doesn't seem to be set. When a user try to log in, the user is prompted whith a new login-dialog. The server is running PHP 5.3.3 and I have tried with Google Chrome and Internet Explorer. Here is the simple example that I used: <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="Jonas Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'User pressed Cancel'; exit; } else { echo "<p>Hello {$_SERVER['PHP

Spring Rest Service - Invalid CSRF token when I attempt to login

南楼画角 提交于 2019-11-30 04:15:27
问题 I have a Spring MVC REST service, with Spring Security (3.2.5.RELEASE) enabled. When I turn on @EnableWebMvcSecurity, a login form is automatically generated for me at http://localhost:8080/login. If I use this form to login, everything works just fine. The problem occurs when I attempt to login by sending a POST request directly. In my post request, I provide the username and password. I also include the http header 'X-CSRF-TOKEN' and for the header value, I use the JSESSIONID that I see has

Is there a maximum length for a HTTP BASIC authentication username?

故事扮演 提交于 2019-11-30 01:25:47
问题 Is there a maximum length for a username or password which is sent to a web application through HTTP BASIC authentication? I looked through RFC2617 and couldn't find anything obvious, but was curious and wanted to make sure. (This is all being done over SSL, so don't worry about security for my sake.) 回答1: There's no spec-enforced limit on the auth token. However you may run into practical server-specific limits on HTTP headers in general, as outlined in this question. 回答2: According to http:

Authentication issues with WWW-Authenticate: Negotiate

寵の児 提交于 2019-11-30 01:24:05
I am trying to access a site that is password protected. It is not using basic authentication (even though the same user/pass box pops up in firefox) as the response header is WWW-Authenticate: Negotiate . I want to automate the login process by sending the correct header. In basic you would use something like: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== What would I use for negotiate? zcopley The web server is prompting you for a SPNEGO ( Simple and Protected GSSAPI Negotiation Mechanism ) token. This is a Microsoft invention for negotiating a type of authentication to use for Web SSO

Gradle use certificate authentication for repository

一笑奈何 提交于 2019-11-30 00:44:10
The Problem I have a Android Gradle project which should pull a lib from my companys sonatype nexus server. The nexus server uses a certificate authentication. That means the client has a private certificate which authenticates and authorizes him against the nexus server. The problem is how to configure gradle to use my certificate (which is in the osx keystore). /app/build.gradle repositories { // some other repositorys... ... maven { credentials { username = NEXUS_USERNAME password = NEXUS_PASSWORD } url 'https://prefix.server.com/nexus/content/repositories/artifactid' } } Without giving a

Using Basic HTTP access authentication in Django testing framework

可紊 提交于 2019-11-29 22:50:13
For some of my Django views I've created a decorator that performs Basic HTTP access authentication. However, while writing test cases in Django, it took me a while to work out how to authenticate to the view. Here's how I did it. I hope somebody finds this useful. Humphrey Here's how I did it: from django.test import Client import base64 auth_headers = { 'HTTP_AUTHORIZATION': 'Basic ' + base64.b64encode('username:password'), } c = Client() response = c.get('/my-protected-url/', **auth_headers) Note: You will also need to create a user. In your Django TestCase you can update the client

Retrofit POST request w/ Basic HTTP Authentication: “Cannot retry streamed HTTP body”

大憨熊 提交于 2019-11-29 21:07:55
I'm using Retrofit to do a basic POST request, and I'm providing a basic @Body for the request. @POST("/rest/v1/auth/login") LoginResponse login(@Body LoginRequest loginRequest); When I'm building the interface for Retrofit I'm providing my own custom OkHttpClient, and all that I'm doing to it is adding my own custom authentication: @Provides @Singleton public Client providesClient() { OkHttpClient httpClient = new OkHttpClient(); httpClient.setAuthenticator(new OkAuthenticator() { @Override public Credential authenticate(Proxy proxy, URL url, List<Challenge> challenges) throws IOException {