basic-authentication

OpenRasta - Scott Littlewoods Basic Authentication working example

浪子不回头ぞ 提交于 2019-12-04 13:41:04
I'm testing out the feasibility of using OpenRasta as a viable alternative to ASP.NET MVC. However, I've run into a stumbling block regarding authentication. Let me be clear, "Open Digest Authentication" is NOT an option at this point. I've read that Scott Littlewood created a basic authentication fork for OpenRasta and I've downloaded the source from git and successfully built it. I'm now trying to get the authentication working, so if someone has a real working model, I would be very grateful. Here's what I've done so far: //Authentication.cs using System; using System.Collections.Generic;

How to check contents of incoming HTTP header request

跟風遠走 提交于 2019-12-04 12:57:21
I'm playing around with some APIs and I'm trying to figure this out. I am making a basic HTTP authenticated request to my server via the API. As part of this request, the authenticated key is stored in the HTTP header as username. So my question is, how do I get the contents of the incoming request such that I can perform a check against it? What I am trying to do: if incoming request has header == 'myheader': do some stuff else: return ('not authorised') For those interested, I am trying to get this to work. UPDATE I am using Django http://docs.djangoproject.com/en/dev/ref/request-response/

How to use Basic Authentication with JIRA REST API in JavaScript?

狂风中的少年 提交于 2019-12-04 11:47:06
问题 I'm creating a JavaScript app for a Smart TV to show dashboards on the tv. I get the list of dashboards with the JIRA REST API. The url I use for this is: jira/rest/api/2/dashboard?startAt=&maxResults= afterwards I create a wallboard as followed to show them on the tv: jira/plugins/servlet/Wallboard/?dashboardId=&os_username=&os_password= because of the os_username and os_password , JIRA knows i'm authenticated and gets the right list. this list is the one i need from the beginning but

How to do ASP.NET Web API integration tests with authorize attribute

痞子三分冷 提交于 2019-12-04 10:50:26
I do have authorize attribute applied on my Web API. I am calling Web API from MVC4 application in which I am using standard cookie based authentication. I need to call Web API method on controllers from integration tests but because authorize attribute is applied I will always receive unauthorized exception . What is the best way to solve this problem ? PS. I don't want (need) to use other methods of authentication such as APIKey,Token in Auth Header and similar... First of all, one key element in order to answer this question is to know what kind of authentication mechanism you use. For

How do you access the HTTP basic authentication username from perl?

泪湿孤枕 提交于 2019-12-04 10:38:00
I need to get the remote user name in my CGI script. Where do I find that? I want to display that name on the page that I return. Under the CGI spec, the HTTP-auth user name will be in the environment variable REMOTE_USER . In Perl you can get this via $ENV{REMOTE_USER} . You can find descriptions of all the standard CGI environment variables, including REMOTE_USER , in section 4 of RFC 3875 . Christoffer Hammarström The remote_user() method in the CGI module . If you're not using the CGI module, the environment variable REMOTE_USER: $ENV{REMOTE_USER} 来源: https://stackoverflow.com/questions

ServiceStack Authentication with Existing Database

陌路散爱 提交于 2019-12-04 08:37:58
I've been looking at ServiceStack and I'm trying to understand how to use BasicAuthentication on a service with an existing database. I would like to generate a public key (username) and secret key (password) and put that in an existing user record. The user would then pass that to the ServiceStack endpoint along with their request. What do I need to implement in the ServiceStack stack to get this working? I have looked at both IUserAuthRepository and CredentialsAuthProvider base class and it looks like I should just implement IUserAuthRepository on top of my existing database tables. I am

Apache basic authentication except for those Allowed

醉酒当歌 提交于 2019-12-04 07:58:21
问题 Problem: I have some files under /var/www/files/ that I want them to be accessed from specific IP addresses WITHOUT requiring user/password. However, I would like that any other IP address SHOULD require login to gain access. This is in my httpd.conf: <Directory /var/www/files/> Order deny,allow Deny from all Allow from 192.168 AuthUserFile /etc/apache2/basic.pwd AuthName "Please enter username and password" AuthType Basic Require user valid-user </Directory> But, if I understood correctly,

How to send post request with basic auth in retrofit?

Deadly 提交于 2019-12-04 07:55:21
In my code, I want to send post request with basic auth. Here is my postman screenshot : here is my apiInterface class @FormUrlEncoded @POST("GetBarcodeDetail") Call<PreliminaryGoodsAcceptResponse> PRELIMINARY_GOODS_ACCEPT_RESPONSE_CALL(@Field("ProcName") String procName, @Field("Barcode") String barcode, @Field("LangCode") String langCode); here is my apiclient public class ApiClient { public static final String BASE_URL = "http://192.**********"; private static Retrofit retrofit = null; private static OkHttpClient sClient; public static Retrofit getClient() { if(sClient == null) {

How do I exclude a path from requiring basic auth in Sinatra

你。 提交于 2019-12-04 07:14:25
I'm writing a smallish web service in Ruby using Sinatra. Access to pretty much everything is controlled using http basic auth (over https in production). There is one particular directory that I want to exclude from requiring authorization. Is there an easy way to do this? require 'sinatra' helpers do def protected! unless authorized? response['WWW-Authenticate'] = %(Basic realm="Testing HTTP Auth") throw(:halt, [401, "Not authorized\n"]) end end def authorized? @auth ||= Rack::Auth::Basic::Request.new(request.env) @auth.provided? && @auth.basic? && @auth.credentials && @auth.credentials == [

How to pass through window asking for basic auth credentials that appears when click link redirecting from HTTP to HTTPS?

妖精的绣舞 提交于 2019-12-04 07:14:18
I have a website where most of pages are normally used via HTTP but some other pages are available only via HTTPS. Site is protected by basic auth (credentials are the same for HTTP and HTTPS pages). When I open any HTTP page in browser (either FF or Chrome) and click link that leads to HTTPS page, browser shows alert that asks for basic auth credentials. I have same issue with Webdriver (either FF or Chrome): When I visit http://username:password@some_domain.com and click link that leads to HTTPS page, browser alert window that asks for basic auth credentials appears. Selenium doesn't