basic-authentication

How to logout user for basic HTTP authentication

▼魔方 西西 提交于 2019-11-28 05:46:14
问题 Is there a solution to logout a user (make a browser clear its cached credentials and ask user to login credential once again) for basic HTTP authentication? I've already looked through the following questions: logout with basic authentication without closing webbrowser like banking sites will display HTTP authentication logout via PHP 回答1: Yes, but it's not very smooth. You have a special script URL (eg /logout ; like a login script it must be in the root of the webapp to ensure the auth

Why my server ignores the authentication headers from an ajax request?

送分小仙女□ 提交于 2019-11-28 05:32:23
问题 From JavaScript I used: xhr.setRequestHeader("Authorization", make_base_auth(username,password)); However the HTTP request doesn't have an Authorization header: OPTIONS /restService/index?_=1362589672203 HTTP/1.1 Host: myappinheroku.herokuapp.com User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: es-MX,es-ES;q=0.8,es-AR;q=0.7,es;q=0.5,en-US;q=0.3,en;q=0.2 Accept-Encoding: gzip,

ASP.net Web API RESTful web service + Basic authentication

强颜欢笑 提交于 2019-11-28 04:40:40
I'm implementing a RESTful web service using ASP.Net Web Api. I have concluded to use Basic authentication + SSL to do the authentication part. What is the best/correct way to implement that? My first attempt was to do it manually, parsing the Authorization header, decoding and verifying the user against my database. It works, but I wonder if I am missing something. I've seen some solutions using user roles and principals. While I'm not sure what these actually do, I'm almost sure I will not be needing these, since in my database I define my own users and their roles. Also what I haven't yet

Using HTTP Basic-Auth with Google App Engine URLFetch service

余生长醉 提交于 2019-11-28 04:23:09
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? Zombies This is a basic auth header over http: Authorization: Basic base64 encoded(username:password) eg: GET /private/index.html HTTP/1.0 Host: myhost.com Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== You

Calling a rest api with username and password - how to

試著忘記壹切 提交于 2019-11-28 04:21:33
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() as HttpWebResponse; However I get a 401 unauthorized error. What am I missing, how do I form api calls

IIS7 and Authentication problems

大城市里の小女人 提交于 2019-11-28 04:11:37
问题 i've got a stock standard ASP.NET web site, deployed to our development machine (internal machine in our server room). Now, this dev site can be accessed by both INTERNAL and EXTERNAL users. Now, in IIS6 we used to have it so that Anonymous Authentication was turned off and something else was turned on .. giving the users a popup model box for username and password. I think they had to type some username or password that was defined in a web.config file? (not their website account username

Does securing a REST application with a JWT and Basic authentication make sense?

别说谁变了你拦得住时间么 提交于 2019-11-28 03:06:34
I have a Spring REST application which at first was secured with Basic authentication. Then I added a login controller that creates a JWT JSON Web Token which is used in subsequent requests. Could I move the following code out of the login controller and into the security filter? Then I would not need the login controller any longer. tokenAuthenticationService.addTokenToResponseHeader(responseHeaders, credentialsResource.getEmail()); Or could I remove the Basic authentication? Is it a good design to mix Basic authentication with a JWT? Although it all works fine, I'm a bit in the dark here as

Error “HTTP/1.1 401 Unauthorized” with basic authentication in android - EWS 2010

耗尽温柔 提交于 2019-11-28 02:28:43
问题 I refer to this link to request to the server. The problem is sometime (not always, about 20% - 30%, means sometime I can get successful response), I got the 401 error and server response basic authorization challenge expected, but not found . Here is my code: HttpRequestInterceptor preemptiveAuth = new HttpRequestInterceptor() { public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException { AuthState authState = (AuthState) context .getAttribute

Basic authentication with Selenium in Internet Explorer 10

冷暖自知 提交于 2019-11-27 23:12:40
One of our webapplications is using Basic Authentication and build with AngularJS. To test this application, I use Protractor, which uses Selenium to communicate with browsers. In Chrome, everything works fine and doing basic authentication is easy: username:password@host.ext Under Internet Explorer, the URL's with password and username are expected to be a security risk and are therefor not allowed. Until Internet Explorer 9, this setting could be turned off in the registry (FEATURE_HTTP_USERNAME_PASSWORD_DISABLE) . When setting this registry key for Internet Explorer 10, the behaviour

Authenticate Windows Authentication using Javascript

只谈情不闲聊 提交于 2019-11-27 22:17:13
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 this thread How can I pass windows authentication to webservice using jQuery? But it does not work. When