basic-authentication

Basic authentication with header - Javascript XMLHttpRequest

﹥>﹥吖頭↗ 提交于 2019-12-18 07:21:04
问题 I am trying to access Adyen test API that requires basic authentication credentials. https://docs.adyen.com/developers/ecommerce-integration My credentials work when accessing the API page through browser. But I get an 401 Unauthorized response when trying to access the API with XMLHttpRequest POST request. Javascript Code var url = "https://pal-test.adyen.com/pal/servlet/Payment/v25/authorise"; var username = "ws@Company.CompanyName"; var password = "J}5fJ6+?e6&lh/Zb0>r5y2W5t"; var

Spring security 3 http-basic authentication-success-handler

青春壹個敷衍的年華 提交于 2019-12-18 04:55:09
问题 H i'm using spring security for form-login i have <http auto-config="true"> <intercept-url pattern="/pages/**" access="ROLE_USER" /> <form-login authentication-success-handler-ref="authenticationSuccessHandler" login-page="/login.html" default-target-url="/pages/index.html" always-use-default-target="true" authentication-failure-url="/login.html" /> <logout logout-success-url="/login.html" invalidate-session="true" /> <anonymous enabled='false'/> </http> here i can set an authentication

Symfony2 http_basic security rejects valid credentials

别来无恙 提交于 2019-12-18 04:38:20
问题 I use Symfony Standard 2.0.0BETA1 and tried to configure http_basic authentication exactly the same as in this book chapter security: encoders: Symfony\Component\Security\Core\User\User: plaintext providers: main: users: foo: { password: testing, roles: ROLE_USER } firewalls: main: pattern: /.* http_basic: true logout: true access_control: - { path: /.*, role: ROLE_USER } Problem is when I try to open a page and i submit user name "foo" and password "testing" it simply loops and ask me for

What is the cleanest way to do HTTP POST with basic auth in Python?

邮差的信 提交于 2019-12-18 01:57:24
问题 What is the cleanest way to do HTTP POST with Basic Auth in Python? Using only the Python core libs. 回答1: Seriously, just use requests: import requests resp = requests.post(url, data={}, auth=('user', 'pass')) It's a pure python library, installing is as easy as easy_install requests or pip install requests . It has an extremely simple and easy to use API, and it fixes bugs in urllib2 so you don't have to. Don't make your life harder because of silly self-imposed requirements. 回答2: Hackish

Asmx web service basic authentication

南楼画角 提交于 2019-12-17 22:37:45
问题 I want to implement basic authentication using username and password validation in my asmx web service. I don't want to use WCF and I know this is not secure way , but I need to use basic authentication without using https. My web service is like this: [WebService(Namespace = "http://www.mywebsite.com/")] public class Service1 { [WebMethod] public string HelloWorld() { return "Hello world"; } } And I use this custom HttpModule: public class BasicAuthHttpModule : IHttpModule { void IHttpModule

Converting curl cmd to jQuery $.ajax()

耗尽温柔 提交于 2019-12-17 22:35:24
问题 I'm trying to make a api call with jquery ajax, I have curl working for the api, but my ajax is throwing HTTP 500 I have a curl command working that looks like this: curl -u "username:password" -H "Content-Type: application/json" -H "Accept: application/json" -d '{"foo":"bar"}' http://www.example.com/api I tried ajax like this, but it is not working: $.ajax({ url: "http://www.example.com/api", beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", "Basic " + btoa("username:password

Apache2 Reverse Proxy to an end-point that requires BasicAuth but want to hide this from user

半城伤御伤魂 提交于 2019-12-17 21:53:50
问题 Basically my scenario is that I have an internal website that requires a SINGLE hard-coded username and password to access (and this can't be turned off, only changed). I am exposing this website through a reverse proxy for various reasons (hiding the port, simplifying url, simplifying NAT, etc). However, what I would like to do is be able to use Apache to handle the authentication so that: I don't have to give out single password to everyone I can have multiple usernames and passwords using

HTTP Basic Authentication - what's the expected browser experience?

怎甘沉沦 提交于 2019-12-17 21:27:24
问题 When a server allows access via Basic HTTP Authentication, what is the experience expected to be on the browser? I typically just do this with curl: curl -u myusername:mypassword http://somesite.com And it works just fine. However, right now I don't have access to curl (long story), and I want to just do it from the web browser, if possible. I thought the way Basic Auth was supposed to work was - I type in the url I want, the server then decides I'm not authorized, returns response code 401,

Authentication with WKWebView in Swift

旧街凉风 提交于 2019-12-17 20:05:29
问题 In my iOS app, I would like to use a WKWebView to wrap an external URL in the application. This URL requires basic authentication (it needs user and password credential, like in the following screenshot). After some investigation, I'm trying to use didReceiveAuthenticationChallenge method, in order to enable an automatic login, so I'm not understanding how it works. This is my code. import UIKit import WebKit class WebViewController: UIViewController, WKNavigationDelegate { var webView:

Cookies vs Basic Auth

雨燕双飞 提交于 2019-12-17 18:26:10
问题 Why almost all websites out there are using cookies instead of basic auth? It can't be only that the user/pass window is ugly and none of them is more secure. They are both insecure (without https). 回答1: To logout of a basic auth login the browser often needs to be quit entirely. This means there is no way for the server to log out the user. I believe basic auth also has more overhead (assuming your cookie size isn't massive), but I might be wrong about that. HTTP basic auth also sends the