w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

nodejs can't send request to remote https server
Did you compile from source? If openssl libs were not available at the ./configure step of compiling, node will not be able to connect to any SSL end-point. See this post for info on compiling node: node js can't install right on my Ubuntu computer

Categories : Node Js

Savon HTTPS Request with HTTP authentication
HTTP error (401) means your attempt to authorize failed. Usually it's a problem with the userid/password. Farther into the HTML returned it says: HTTP Status 401 - No user credentials found I think you need to make sure your userid and password are correct.

Categories : Ruby

Using functions inside scripts required by NodeJS's required()
If it is not a part of module.exports then you can't. For example: web-notification.js function getURL(host, path) { ... } module.exports = exports = { getURL: getURL }; main-js.js var webnotis = require('./modules/web-notification.js'); webnotis.getURL(...);

Categories : Javascript

HTTPS GET request to https://www.googleapis.com/plus/v1/people/me
Create a Google_Oauth2Service object (put it under the $plus initialization), like: $client = new Google_Client(); $plus = new Google_PlusService($client); $oauth2 = new Google_Oauth2Service($client); and after succesfully authenticating the client use: $userInfo = $oauth2->userinfo->get(); $email = $userInfo['email'];

Categories : PHP

NodeJS create https from existing tls.Server
There isn't any official/supported way for that. However if you look at the source code of https server, it's just a glue that connects together TLS server and HTTP connection handler: function Server(opts, requestListener) { if (!(this instanceof Server)) return new Server(opts, requestListener); if (process.features.tls_npn && !opts.NPNProtocols) { opts.NPNProtocols = ['http/1.1', 'http/1.0']; } /// This is the part where we instruct TLS server to use /// HTTP code to handle incoming connections. tls.Server.call(this, opts, http._connectionListener); this.httpAllowHalfOpen = false; if (requestListener) { this.addListener('request', requestListener); } this.addListener('clientError', function(err, conn) { conn.destroy(); }); this.timeou

Categories : Javascript

Per https Authentication fails
I speculate that in your use of the 4 parameter form of the credentials method, the netloc and user are wrong. When the URL is https://www.example.com/foo/bar?quux;baz=42#fnord, the netloc is www.example.com:443. The user is a string of the NTLM domain, a single backslash, and the NTLM username, e.g. internalernd. Mind that if you hardcode that value as a string literal as you did in the example, you need to escape the backslash with a backslash. Check for these possible errors.

Categories : Perl

Is it required to use sessions while writing API in nodejs?
You don't need session management when you're writing a RESTful API unless you plan on doing something that would need to authenticate the user across multiple requests. For example, maybe you want a user with a cookie to not need to use an API token or you want to cut back on database requests by using cookies. Most REST services just look up a user using some kind of API key or token though, so no sessions are necessary. These questions might be helpful: Do sessions really violate RESTfulness? Is it good to implement REST api using Sessions?

Categories : Node Js

NodeJS required module not available in other modules
Each file has to include references to modules index.js var fs = require("fs"), other = require("./otherfile"); // you can now use `fs` otherfile.js var fs = require("fs"); // you can now use `fs` here One of the best parts about this is you're not locked into naming the variable a certain way in any given file. Every file is pretty much isolated from all the other files in your lib, and that's a very good thing. Also know that you can include just parts a module if you'd like var read = require("fs").readFile; read("myfile.txt", function(err, data) { if (error) { return throw error; } console.log(data); }; Explanation: Node.js does not encourage the use of globals; and as such, you should not try to implement things that depend on global variables. Whe

Categories : Node Js

https basic authentication perfomance
The performance issue with basic authentication could be because of the extra round trip for each call, i.e. client sends request then server asks for authentication and then client sends authentication information. Also, this involves storing the username and password for sending them in each call. Normally, people get around this using token authentication. Initially, client uses basic authentication to send username and password. At this point the server sends a "token" to the client(Normally a cryptic looking string which only the server can decode). The client saves this token and sends it the subsequent requests in a custom HTTP header field. The server checks if the supplied token is valid and it hasn't expired. If it is valid the server knows the client already has been authentica

Categories : Performance

Is this HTTPS authentication protocol secure?
The security bases on the certificate you use for encryption. In general this is enough, you may also check if it is the expected certificate. In the case that you check yourself the fingerprint of the certificate you can be sure (if you use sha1 or better) that the certificate is from you and not a successful man in the middle attack. E.g. the NSA could simple create valid certificates for your domain, but AFIK it is impossible to generate a second certficate with the same fingerprint. By the way I hope that the passwords and tokes are also salted. That is important so it is impossible to see that two customers uses the same password and also it increases the complexity of the hash, that means that it will take much more time to crack such a password with a rainbow table.

Categories : Security

(1002) - No available client connector supports the required protocol: 'HTTPS'
This issue has been fully solved in Restlet version 2.2 where the internal HTTP/HTTPS connector is now based on HttpURLConnection, there requiring NO additional dependencies. It is lightweigth and doesn't need to use the Apache HTTP Client API. This works especially well for the Android edition.

Categories : Android

Certificate authentication of rest api in Azure with https
Did you also tried getting your certificate by "Thumbprint". here is a sample code that tries to read a certificate from certificate store. private X509Certificate2 FindCertificate() { X509Store certificateStore = new X509Store(StoreName.My, StoreLocation.CurrentUser); certificateStore.Open(OpenFlags.ReadOnly); X509Certificate2Collection certificates = certificateStore.Certificates; X509Certificate2Collection matchingCertificates = certificates.Find(X509FindType.FindByThumbprint, "CertThumbprint", false); if (matchingCertificates != null && matchingCertificates.Count > 0) { return matchingCertificates[0]; } throw new ArgumentException("Unable to find a matching certificate in the certificate store. Please modify the search criteria."); }

Categories : Asp Net

Java 6 HTTPS client certificate authentication
After a deep investigation of HTTPS protocol traffic I found out that Java 6 doesn't support SNI and this feature was added only in Java 7. My Nginx server have several HTTPS VirtualHosts on the same IP and because of Java 6 doesn't pass the exact hostname the default host was returned. To resolve this issue you just need to mark your VirtualHost with client side authentication as the default one: listen xxx.xxx.xxx.xxx:443 default;

Categories : Java

Call a HTTPS WCF Service with Certificate authentication
Got a solution: In the ajax call i made a call to the controller <script> $(document).ready(function () { $("#GetAdjustedSalary").click(function () { var salary = parseFloat($("#salary").val()); var infalation = parseFloat($("#inflation").val()); var object = { salary: salary, infalation: infalation } var data = JSON.stringify(object); $.ajax({ url: "Home/GetData/", type: "POST", data: data, dataType: "JSON", contentType: "application/json", success: function (data) { $("#answer").html(data); } }); }); }); Then in the controller: [HttpPost] public ActionResult GetData(string salary,

Categories : Wcf

Coming from AOP based authentication in ASP.MVC to nodeJS
As there has been no answers I will mention what I have done, which is made a class which contains the logic that needs to be carried out on the route, then made a function that is exported as the middleware entry point. That way I can unit test the logic and use the middleware to inject the "concern" into that route.

Categories : C#

nodejs passport authentication token
Simply use the access token on every request. Using a session is NOT needed. The following is the workflow: POST /signin The username and password are posted in the client request. The server authenticates the user by using passport's Local Strategy. See passport-local. If the credentials represent a valid user, the server returns the access token generated by some generator. node-jwt-simple is a good choice. If the credentials are invalid, redirect to /signin. When the client receives the access token from the authorization server, it can then make requests to protected resources on the server. For example: GET /api/v1/somefunction?token='abcedf' The client calls some server api with the token argument. The server authenticates the token by using passport's Bearer Strategy. See p

Categories : Node Js

NodeJS Native basic authentication
So HTTP auth has a confusing thing. When you have a URL with credentials like this https://user:password@example.com', that will parse just fine withurl.parse`: url.parse('https://user:password@example.com') { protocol: 'https:', slashes: true, auth: 'user:password', host: 'example.com', port: null, hostname: 'example.com', hash: null, search: null, query: null, pathname: '/', path: '/', href: 'https://user:password@example.com/' } Note it's url.parse(theUrl).auth not url.parse(theUrl).query.auth as you have. However, that is the URL itself, just that string. If you tell an HTTP library to actually request that URL, the credentials get translated into an HTTP request header, just as the rest of the URL like the host, path, port, etc each gets converted into the d

Categories : Node Js

Stateless Authentication Library in NodeJS
I am currently developing a REST API and using PassportJS Basic Auth (for dev purposes) with no sessions. You can tell the strategy to not use sessions: passport.authenticate( 'basic', { 'session' : false } ) passport.authenticate( 'bearer', { 'session' : false } ) passport.authenticate( 'token', { 'session' : false } ) See here at the bottom.

Categories : Node Js

Trying to get http response over https and basic authentication - getting "Unauthorized"
You're incorrectly utilizing the AuthScope httpClient.getCredentialsProvider().setCredentials( new AuthScope("https://openmiddleware.pl", 443), new UsernamePasswordCredentials("user", "pass")); It should be httpClient.getCredentialsProvider().setCredentials( new AuthScope("openmiddleware.pl", 443), new UsernamePasswordCredentials("user", "pass")); AuthScope takes a hostname and a port number.

Categories : Java

Authentication and/or HTTPS with Plack/PSGI/Poet application
You could run your application behind some webserver like Apache that knows how to safely authenticate users. To do this, you have two options: Use FastCGI Proxy requests to your app. To go the FastCGI route, use plackup like this: plackup -s FCGI myapp.psgi And in your Apache config, use something like this: LoadModule fastcgi_module libexec/mod_fastcgi.so <IfModule mod_fastcgi.c> FastCgiExternalServer /tmp/myapp.fcgi -host localhost:5000 Alias /myapp/ /tmp/myapp.fcgi/ </IfModule> Alternatively, you can make Apache proxy requests to your app: ProxyPass /myapp http://localhost:5000/ Since plackup is not recommended for production systems, you should look into Starman, which will limit your options to the proxy solution.

Categories : Perl

JSoup Authentication Required Dialog
I wasn't able to authenticate using JSoup, but I managed to create a work around. What I did is to implement org.apache.commons.httpclient.HttpClient and org.apache.commons.httpclient.methods.GetMethod for connecting and getting the DataInputStreamReader. The DataInputStreamReader will be passed to JSoup, so we can use JSoup for parsing the xml/html. See the code below: // codes GetMethod method = new GetMethod(url); // passing the credentials HttpClient httpClient = new HttpClient(); httpClient.getState().setCredentials(org.apache.commons.httpclient.auth.AuthScope.ANY, new org.apache.commons.httpclient.NTCredentials(username,pass,url,domain)); Document doc = null; // org.jsoup.nodes.Document if( http.executeMethod(method)==200){ doc = Jsoup.parse(new DataInputStream(method.

Categories : Java

NodeJS authentication with passport using facebook strategy
Well passport does in fact support this. You can specify permissions in the scope object like this app.get('/auth/facebook', passport.authenticate('facebook', { scope: ['read_stream', 'publish_actions'] }) ); This is mentioned in the passport docs. Here is the list of permissions that you can actually request from Facebook.

Categories : Node Js

MVC Application endpoint Authentication Required for subdomain
If you have authentication on the main site, it won't automatically carry authentication across to the sub-domain. You would have to develop a mechanism to handle that such as SSO (single sign on). Another potential issue is permissions for the directory/application (eg. c:inetpubwwwrootcrm.mysite.com)

Categories : Asp Net Mvc

gmail via oauth SMTPSendFailedException(Authentication Required)
I fixed this probrem. I used [gmail api python sample] as a reference. add this code before [transport.sendMessage(...] byte[] bAuth = String.format("user=%s1auth=Bearer %s11", "send-addr@gmail.com", oAuthToken).getBytes(); String authStr = new String(BASE64EncoderStream.encode(bAuth)); transport.issueCommand("AUTH XOAUTH2 " + authStr, 235); transport.sendMessage(message, message.getAllRecipients());

Categories : Android

HTTP Error 407 Proxy authentication required
I had the same problem. The following worked for me. Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("username","password".toCharArray()); } });

Categories : Java

IIS handles request much longer when request originates from another computer and returns HTTP 200 and text
So a request from localhost is quicker than a request from a remote computer. That makes perfect sense - the localhost doesn't have to do a network request out to the network, find a remote host, send the request over the network and then wait for a response. Having said that - if your application is taking 15ms locally and 260ms on even a relatively close network, then it's slow :).

Categories : Dotnet

PHP cURL returns FALSE on HTTPS
You can prevent cURL from trying to verify the SSL certificate by using CURLOPT_VERIFYPEER. Also set the action in the URL: $ch = curl_init(); $data = array('user' => 'xxx', 'password' => 'yyy'); curl_setopt($ch, CURLOPT_URL, 'https://coinroll.it/getbalance'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($ch); echo $result;

Categories : PHP

Trouble with simple https authentication with urllib2 (to get PayPal OAUTH bearer token)
Experiencing the same problem here. Based on Get access token from Paypal in Python - Using urllib2 or requests library working python code is: import urllib import urllib2 import base64 token_url = 'https://api.sandbox.paypal.com/v1/oauth2/token' client_id = '.....' client_secret = '....' credentials = "%s:%s" % (client_id, client_secret) encode_credential = base64.b64encode(credentials.encode('utf-8')).decode('utf-8').replace(" ", "") header_params = { "Authorization": ("Basic %s" % encode_credential), "Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json" } param = { 'grant_type': 'client_credentials', } data = urllib.urlencode(param) request = urllib2.Request(token_url, data, header_params) response = urllib2.urlopen(request).open() print

Categories : Python

Authentication mechanisms for a AngularJS/NodeJS/RESTEasy+JBoss/LDAP stack
I suppose you can generate an auth token for a given section in JBoss, the token is: put in a data store accessible to the node server (could be MongoDB, CouchDB, you name it) stored in client's cookie to the node server The node server can then use the token to cross verify if the client has been properly authenticated and protects pages (other then the login page).

Categories : Javascript

Python Https Request
I strongly recommend you use mechanize when dealing with forms on the web. You simply need to create a Browser() object and start navigating the site, sometimes you need to include a cookie jar to handle cookies. As far as being informed what the field names of the form are, I recommend going through the source code of the HTML page you are trying to log into. You could also use mechanize to iterate through all the forms in a site and print each field value. Here you have an example of how to deal with forms in mechanize. Luck !

Categories : Python

HTTPS request in c++ using Poco
I found the answer. I wasn't really getting the certificate. It works like this: try{ Poco::Net::initializeSSL(); Poco::SharedPtr<Poco::Net::InvalidCertificateHandler> ptrHandler = new AcceptCertificateHandler(false); Context::Ptr ptrContext = new Context(Context::CLIENT_USE, "", "", "", Context::VERIFY_RELAXED, 9, true, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"); SSLManager::instance().initializeClient(0, ptrHandler, ptrContext); Poco::Net::SocketAddress address("www.server.com:443"); Poco::Net::SecureStreamSocket socket(address); if (socket.havePeerCertificate()) { X509Certificate cert = socket.peerCertificate(); std::cout<<cert.issuerName()<<" "; } else { std::cout<<"No certificate"; } }catch

Categories : C++

how to see httpS request & headers on win?
If you have the SSL private key, then you can decrypt the HTTPS packet using the Wireshark. http://wiki.wireshark.org/SSL If not, it is difficult.

Categories : Rest

HTTPS post request in IOS
The certificate for the site you're trying to connect to is untrusted (try visiting the link you posted in Chrome). By default, iOS won't let you connect to site that presents an untrusted certificate. You can bypass this check if absolutely necessary - see this question: How to use NSURLConnection to connect with SSL for an untrusted cert? However, it's going to much, much, much better to actually fix the certificate in question.

Categories : IOS

nodejs + ejs for if express returns a unexpected catch
If the example you provided is indeed all of your code, you aren't closing all of your tags, specifically, you aren't closing your for loop, one of your divs, or your form. When I close all of these, the view will render for me without errors. This is the ejs that I used: <!DOCTYPE html> <html> <head> <title><%= title %></title> <link rel='stylesheet' href='/stylesheets/style-min.css' /> </head> <body> <h1 id="page-title"><%= title %></h1> <div id="list"> <form action="user/create/" method="post" accept-charset="utf-8"> <div class="item-new"> <% for (var key in userData){ %> <% if(key != 'birthdate'){ %> <input class="in

Categories : Node Js

Writing async http returns in Nodejs
Async functions will never return something that has to fetched with async. getWebPageBody in your case returns undefined, and then later your callbacks happen. In synchronous programming you return a value. But in async, you provide it as an argument to a callback function. So instead, make your function accept a callback argument, and simply call it when you are done. var getWebPageBody = function(res, callback) { var pageRes = ""; res.setEncoding('utf8'); res.on('data', function(requestBody) { pageRes = requestBody; console.log('[ DEBUG ] BODY: ' + pageRes);

Categories : Node Js

SSL Error Twitter Request using HTTPS
I had the same error. I still havn't been able able to resolve the underlying issues but try pasting this into your .rb files. OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE It basically turns off the verification step.

Categories : Ruby

https Request for CSS file gives 502 Bad Gateway
try calling your css by just <link href="./test/Style/Secure/en/BodyStyle.css" rel="stylesheet" /> When you are using https, it binds it to your whole entire domain name. If want your css3 to be hidden from the rest the public, this is impossible when you are importing through html. Browsers need this file to render ur html designs properly.

Categories : Asp Net

HTTPS request on iphone not sent to server
Add this to the end of your AppDelegate.m file @implementation NSURLRequest(DataController) + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host { return YES; } @end

Categories : Iphone

PATCH https request from Parse
you don't need patch method. if you want update a node you should use put method. example; i want to change https://testapp.firebaseio.com/firstnode/node/user value my request; var x = { "user": "0101010101"}; Parse.Cloud.httpRequest({ method: 'PUT', url: 'https://testapp.firebaseio.com/firstnode/node/.json', headers: { 'Content-Type': 'application/json;charset=utf-8' }, body: x }).then(function(httpResponse) { console.log(httpResponse.text); }, function(httpResponse) { console.error('Request failed with response code ' + httpResponse.status); });

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.