basic-authentication

Yii 2 RESTful API authenticate with HTTP Basic (Yii 2 advanced template)

我们两清 提交于 2019-12-03 06:02:45
问题 REST API is working without authentication methods. Now i wanted to authenticate REST API with HTTP Basic authentication for API requests via mobile application. I tried with yii2 guide, but it didn't work for me. basically mobile user need to be login with username & password, if a username and password are correct, user need to be login and further API request need to be validate with token. when i debug findIdentityByAccessToken() function $token equal to username. Postman extension used

How do i do HTTP basic authentication using Guzzle?

拜拜、爱过 提交于 2019-12-03 04:04:16
问题 I want to do basic access authentication using Guzzle and i am very new to programming . i have no clue what to do. I tried to do this using curl but my environment requires using guzzle. 回答1: If you're using Guzzle 5.0 or newer , the docs say that basic auth is specified using the auth parameter: $client = new GuzzleHttp\Client(); $response = $client->get('http://www.server.com/endpoint', [ 'auth' => [ 'username', 'password' ] ]); Please note that the syntax is different if you're using

Ruby rest-client file upload as multipart form data with basic authenticaion

百般思念 提交于 2019-12-03 03:34:05
I understand how to make an http request using basic authentication with Ruby's rest-client response = RestClient::Request.new(:method => :get, :url => @base_url + path, :user => @sid, :password => @token).execute and how to post a file as multipart form data RestClient.post '/data', :myfile => File.new("/path/to/image.jpg", 'rb') but I can't seem to figure out how to combine the two in order to post a file to a server which requires basic authentication. Does anyone know what is the best way to create this request? robustus How about using a RestClient::Payload with RestClient::Request ...

Logout from web app using tomcat Basic authentication

巧了我就是萌 提交于 2019-12-03 02:59:30
I am using tomcat basic authentication for my web app: I added following lines to web.xml in my web app: <security-constraint> <web-resource-collection> <web-resource-name>webpages</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>*</role-name> </auth-constraint> <user-data-constraint> <!-- transport-guarantee can be CONFIDENTIAL, INTEGRAL, or NONE --> <transport-guarantee>NONE</transport-guarantee> </user-data-constraint> </security-constraint> <login-config> <auth-method>BASIC</auth-method> </login-config> <security-role> <role-name>*<

How Do I Get By The Basic Authentication Handshake When Using Fiddler To Test A WCF REST Service?

一曲冷凌霜 提交于 2019-12-03 02:56:57
How Do I Get By The Basic Authentication Handshake When Using Fiddler To Test A WCF REST Service? You need to base64 encode your username:password and then prefix it with Basic. It will end up looking something like: Authorization: Basic VEFWSVNcZGFycmVsOg== You then enter this in the request headers field. 来源: https://stackoverflow.com/questions/4947781/how-do-i-get-by-the-basic-authentication-handshake-when-using-fiddler-to-test-a

Embedding a Secured Grafana into Web Application

主宰稳场 提交于 2019-12-03 02:22:31
I want to embed Grafana into my web application using AngularJS. The goal is, when user is in my application, she should be able to click on a button and load the Grafana UI. In itself, this is an easy task. To do this, I have apache proxying Grafana and returning any necessary CORS headers. The apache reverse proxy config is as follows: Header always set Access-Control-Allow-Origin "*" Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" Header always set Access-Control-Max-Age "1000" Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type,

nginx and auth_basic

一曲冷凌霜 提交于 2019-12-03 01:42:45
I am trying to get basic authentication working with nginx in Ubuntu Jaunty. In nginx.conf, I added these two lines under the server context: server { ... auth_basic "Restricted Access"; auth_basic_user_file /etc/nginx/.htpasswd; ... } Then I apt-get'ed apache2-utils to get htpasswd, which I used to create the htpasswd file: htpasswd -d -c /etc/nginx/.htpasswd joe When I try to access the site, the authentication dialog comes up as expected, but when I put in the username and password, it just refreshed the dialog box. It doesn't seem to like the password I am providing it. I tried running

Spring Security 3.0 : Basic Auth Prompt disappear

删除回忆录丶 提交于 2019-12-02 23:31:31
问题 I am using spring basic authentication with the following settings in my security xml: <http use-expressions="true" create-session="never" > <intercept-url pattern="/**" method="GET" access="isAuthenticated()" /> <intercept-url pattern="/**" method="POST" access="isAuthenticated()" /> <intercept-url pattern="/**" method="PUT" access="isAuthenticated()" /> <intercept-url pattern="/**" method="DELETE" access="isAuthenticated()" /> <http-basic /> </http> If authentication fails, the browser pop

Ajax: HTTP Basic Auth and authentication cookie

余生长醉 提交于 2019-12-02 22:59:52
I want to store the HTTP basic authentication headerline in an authentication cookie, so that I don't have to deal with the authorisation header in subsequent requests (I'm using jQuery): authenticate: function(auth) { var header = "Basic " + $.base64.encode(auth.username + ":" + auth.password); document.cookie = "Authorization: " + header; $.ajax({ type: "GET", url: "http://someurl", contentType: "application/json; charset=utf-8", dataType: "json", success: auth.success, error: auth.error }); }, Whilst this seems to work for the first user who logs in, it doesn't work for any other users

Why would my REST service .NET clients send every request without authentication headers and then retry it with authentication header?

痞子三分冷 提交于 2019-12-02 20:40:16
We happen to run a REST web service with API requiring that clients use Basic authentication. We crafted a set of neat samples in various languages showing how to interface with our service. Now I'm reviewing IIS logs of the service and see that the following pattern happens quite often: a request comes, gets rejected with HTTP code 401 the same request is resent and succeeds which looks like the first request is sent without Authorization headers and then the second one is sent with the right headers and succeeds. Most of the time the log record contains "user-agent" which is the same string