basic-authentication

CORS and HTTP basic auth

北战南征 提交于 2019-11-27 05:52:21
问题 How would a preflighted HTTP request look like if you include Basic auth? Like the following conversation? Im having trouble to understand which headers need to be sent where, also because its not possible to debug it properly with Firebug Client: OPTIONS /api/resource HTTP/1.1 Access-Control-Request-Method: GET Origin: http://jsconsole.com Server: HTTP/1.1 200 OK Access-Control-Allow-Origin: * Access-Control-Allow-Methods: POST, GET, PUT, DELETE Access-Control-Allow-Headers: Authorization

Spring security - unable to logout

给你一囗甜甜゛ 提交于 2019-11-27 05:45:06
问题 I retrofitted my GWT/GXT application with basic LDAP Authorization using basic HTTP authentication. It works well when I start new browser - I get the prompt and get authorized against corporate LDAP. My problem - I can't logout unless I close/reopen the browser. I can debug and see how SecurityContextLogoutHandler#logout is called and the following code is executed if (invalidateHttpSession) { HttpSession session = request.getSession(false); if (session != null) { session.invalidate(); } }

Calling a rest api with username and password - how to

穿精又带淫゛_ 提交于 2019-11-27 05:19:30
问题 I am new to rest api's and calling them via .NET I have an api: https://sub.domain.com/api/operations?param=value&param2=value The notes for the api say that to authorize I need to use the basic access authentication - how do I do that? I currently have this code: WebRequest req = WebRequest.Create(@"https://sub.domain.com/api/operations?param=value&param2=value"); req.Method = "GET"; //req.Credentials = new NetworkCredential("username", "password"); HttpWebResponse resp = req.GetResponse()

Making a HTTP GET request with HTTP-Basic authentication

点点圈 提交于 2019-11-27 03:57:45
I need to build a proxy for a Flash Player project I'm working on. I simply need to make a HTTP GET request with HTTP-Basic authentication to another URL, and serve the response from PHP as if the PHP file was the original source. How can I do this? Using file_get_contents() with a stream to specify the HTTP credentials, or use curl and the CURLOPT_USERPWD option. Marc B did a great job of answering this question. I recently took his approach and wanted to share the resulting code. <?PHP $username = "some-username"; $password = "some-password"; $remote_url = 'http://www.somedomain.com/path/to

HTTP Basic Auth via URL in Firefox does not work?

别说谁变了你拦得住时间么 提交于 2019-11-27 03:36:05
I know that normally you can login to sites that require HTTP basic authentication with Selenium by passing the username and password in the URL, e.g.: selenium.open("http://myusername:myuserpassword@mydomain.com/mypath"); I've been running a Selenium test with Firefox 2 or 3 and there I still get the "Authentication Required" dialog window? Update: It seems not to be a Selenium problem but rather a Firefox issue. If I enter the URL manually within FF I'll get the authentication dialog, but if I enter the URL in Opera, my page is displayed without showing an authentication dialog. Fabricio

Basic HTTP authentication using KSOAP for android

核能气质少年 提交于 2019-11-27 02:55:16
问题 I need to consume a SOAP web service using Android. The issue is that before request for a particular function I need to authenticate a client using basic http request. Do you know how to do this using KSOAP? Until this moment I have tried using overloaded method of httpsTransportSE.call() as it suggest that I can specify additional headers for http connection (ref: https://github.com/mosabua/ksoap2-android/blob/master/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpTransportSE.java)

Why doesn't the browser reuse the authorization headers after an authenticated XMLHttpRequest?

筅森魡賤 提交于 2019-11-27 01:45:06
问题 I'm developing Single Page App using Angular. The backend exposes REST services that require Basic authentication. Getting index.html or any of the scripts does not require authentication. I have an odd situation where one of my view has a <img> where the src is the url of a REST API that requires authentication. The <img> is processed by the browser and I have no chance to set the authorization header for GET request it makes. That causes the browser to prompt for credentials. I attempted to

Using HTTP Basic-Auth with Google App Engine URLFetch service

◇◆丶佛笑我妖孽 提交于 2019-11-27 00:27:46
问题 How can I specify the username and password for making Basic-Auth requests with App Engine's URLFetch service (in Java)? It seems I can set HTTP headers: URL url = new URL("http://www.example.com/comment"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestProperty("X-MyApp-Version", "2.7.3"); What are the appropriate headers for Basic-Auth? 回答1: This is a basic auth header over http: Authorization: Basic base64 encoded(username:password) eg: GET

Basic HTTP authentication in Node.JS?

ぃ、小莉子 提交于 2019-11-26 23:56:01
I'm trying to write a REST-API server with NodeJS like the one used by Joyent , and everything is ok except I can't verify a normal user's authentication. If I jump to a terminal and do curl -u username:password localhost:8000 -X GET , I can't get the values username:password on the NodeJS http server. If my NodeJS http server is something like var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, "127.0.0.1"); , shouldn't I get the values username:password somewhere in the req object

Authenticate Windows Authentication using Javascript

倾然丶 夕夏残阳落幕 提交于 2019-11-26 23:08:39
问题 I have to transfer my client from one website to another website. This happens in client side. In this 2nd website, its using windows basic authentication system. So It popups the login window. I need to omit this Popup window and authenticate my client on 2nd website using javascript and then redirect him to 2nd website. There is no security issue even I put credentials in javascript file since this whole system is running in Intranet. So How to authenticate client on 2nd website ? I found