basic-authentication

apache: basic authentication before rewrite

人盡茶涼 提交于 2019-11-30 03:41:20
问题 I have an apache in frontend that redirect a request via a rewrite rule. I have to put a basic authentication before redirect a request, so I put this in the config file: <VirtualHost *:443> ServerAdmin xxxxxx DocumentRoot /var/www/html/ ServerName xxxxxxx RewriteEngine on ErrorLog logs/error.log CustomLog logs/access_log common <Directory /var/www/html/> AuthType Basic AuthName "Restricted Files" AuthUserFile /etc/httpd/conf/tag.pwd Require valid-user RewriteRule ^/(.*) http://xxxxxx:xxx/$1

Rails 3 http_basic_authenticate_with only in production environment?

我的未来我决定 提交于 2019-11-30 01:05:53
问题 is there a way to only use http_basic_authenticate_with :name => 'user', :password => 'secret' when the server is running on production mode? 回答1: Yes, try: class ApplicationController < ActionController::Base before_filter :authenticate def authenticate if Rails.env.production? authenticate_or_request_with_http_basic do |username, password| username == "user" && password == "%$§$§" end end end end 回答2: Just add this to your example http_basic_authenticate_with :name => 'user', :password =>

HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers

☆樱花仙子☆ 提交于 2019-11-30 00:30:41
问题 i want to allow access to Anonymous.aspx page to all user, i have set Basic Authentication to Enabled , and Connect as to specific user . my problem is when trying to access http://MyIPAddress/MyAlias/Anonymous.aspx , authentication popup appears--ideally it shouldn't, and when i close popup, getting 401.2 Unauthorized error --it's obvious Error Summary HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers. Error Code 0x80070005 below

How to do token based auth using ServiceStack

泪湿孤枕 提交于 2019-11-29 22:35:40
问题 How would I implement the following scenario using ServiceStack? Initial request goes to http://localhost/auth having an Authorization header defined like this: Authorization: Basic skdjflsdkfj= The IAuthProvider implementation validates against a user store and returns a session token as a response body (JSON). The client uses this token an resends it against the subsequent requests like http://localhost/json/reply/orders using the Authorization header like this: Authorization: BasicToken

How can I retrieve Basic Authentication credentials from the header?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 20:15:14
I am trying to write some simple tests User Authentication mechanism which uses Basic Authentication. How can I retrieve the credentials from the header? string authorizationHeader = this.HttpContext.Request.Headers["Authorization"]; Where do I go from here? There are several tutorials but I new to .NET and authentication, could you explain in your answer exactly step-by-step the what and why you are doing. Dawid O From my blog: This will explain in detail how this all works: Step 1 - Understanding Basic Authentication Whenever you use Basic Authentication a header is added to HTTP Request and

Basic authentication for a url in an iframe

强颜欢笑 提交于 2019-11-29 20:06:41
问题 I need to authenticate a request being sent from an iframe (which is being created through javascript) on a page. The authentication will be done with basic http authentication. I've tried doing http://user:password@server but apparently this is unavailable in IE because of a security exception: http://support.microsoft.com/kb/834489 Is there another way I can add the authentication into the request so the iframe will automatically authenticate with the server? Thanks. Here's the code I'm

.htaccess / .htpasswd bypass if at a certain IP address

▼魔方 西西 提交于 2019-11-29 19:32:24
Is it possible to have an .htaccess/.htpasswd access control setup for a given directory, but if they are from a specific IP address, bypass the login/password authentication? I know you can do something like this in the .htaccess file: order deny,allow deny from all allow from 000.000.000.000 But if you add something along these lines: AuthType Basic AuthName "restricted area" AuthUserFile /path/to/.htpasswd require valid-user Then it prompts for the password. Is there any way to do an if/else type setup, or some other solution so that users as a given IP (or set of IPs) don't get prompted

.htaccess basic auth by virtual host?

那年仲夏 提交于 2019-11-29 17:58:57
问题 I was wondering if it was possible to setup a conditional http basic auth requirement based on the virtual host URL in an .htaccess file. For example what I want to do is have mysite.com and test.mysite.com run off the same code base in the same directory but password protect test.mysite.com. It would be setup this way so that I wouldn't need to branch my code since my app code can see which vhost/url it's being served from and pick the database to serve content from. 回答1: You can sort of

Automatically closing an excel popup prompt using VBscript

拈花ヽ惹草 提交于 2019-11-29 17:58:05
I have an excel file that is supposed to access a remote monitoring server through a web query. Since the data in the file has to be periodically refreshed and saved, I have written a .vbs script to do it. It works fine, but since the server uses basic authentification security, which cannot be turned off, each time it runs, excel throws a popup "Windows Security" window asking for the username and password. There is an option to "Save credentials", but it still requires for the user to click "OK" to proceed, but the system requires there to be no user interaction. Googling around I found this

Unable to authenticate with jax-ws on Glassfish

99封情书 提交于 2019-11-29 17:07:36
I have been trying to create a java service that uses basic authentication over SSL. Configuring the SSL was quite simple but configuring authentication is much more of a problem. Any time I try to call a method marked with a @RolesAllowed annotation I receive the following exception... Exception in thread "AWT-EventQueue-0" javax.xml.ws.soap.SOAPFaultException: javax.ejb.EJBAccessException at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178) at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111) at com.sun.xml.internal