JMeter - Auth file is not opening - testing

I am working on JMeter Authorization Manager. I created a Test Plan by adding a Thread Group in it. I have an HTTP Authorization Manager in my Thread Group. I ran my test and it was successful. After that I click Save button of HTTP Authorization Manager. A text file is saved in bin folder named as auth.txt and having this data:
# JMeter generated Authorization file
10.10.10.42 username password
After then I closed the JMeter. Later I wanted to open that .txt file again so that I should not have to enter username and password again, I added an HTTP Authorization Manager and right-clicked on it. Clicked on Open and selected my file auth.txt. But it showed me the error:
: only whitespace content allowed before start tag and not #
(position: START_DOCUMENT seen#...#1:1)
What wrong am I doing, can anybody specify please?
Thanks in advance.

I was just doing wrong way to add Auth file.
It can be added through Load button in HTTP Authorization Manager like this:

Related

security risk when exporting & importing cookies on a Laravel

I am facing a security risk when exporting & importing cookies on a Laravel setup. In short, you can log in to the project without using credentials.
Steps to reproduce:-
Add extension to Chrome - Edit This Cookie . For Firefox - Cookie Editor
Open your Laravel setup on Firefox/Chrome. Login with correct credentials. On the top right, click on Cookie and then click on export. This action will copy all the cookies to your clipboard.
Open your project on another browser (different than step 2). Click on Cookie extension and click on import and paste (your cookies).
Refresh your /login route and you will see that after importing cookies you were able to log in without the right credentials.
Things I've tried so far:-
.env file SESSION_SECURE_COOKIE=true
config/session 'encrypt' => true,
But this is not preventing to login.

Google Sheets API verification flow does not provide a verification code

According to this article, I should enable the Google Sheets API (done), copy and paste a blob of code into file quickstart.php and in terminal on the server run
$ php quickstart.php
This then prompts:
$ php quickstart.php
Open the following link in your browser:
https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=offline&client_id=<something>.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Fmy.website.com%2F&state&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fspreadsheets.readonly&prompt=select_account%20consent
Enter verification code:
So I open the link in my browser, accept that my.website.com gains access to my sheets, and then I'm redirected to the frontpage of my.website.com.
So what do I enter as verification code?
In your case, please check the URL of the redirected page on the browser. When you see the URL, in your situation, I think that you can see the following URL.
http://my.website.com/?code=#####&scope=https://www.googleapis.com/auth/spreadsheets.readonly
In this case, the code is ##### of code=##### which is the query parameter. Please copy the code and put to Enter verification code: of the terminal you run $ php quickstart.php. By this, token.json of $tokenPath = 'token.json'; including the access token and refresh token is created. After this, when you run $ php quickstart.php, the script uses the access token retrieved by the refresh token. By this, the authorization process is not required. About the expiration of the refresh token, please check the official document.
Reference:
Refresh token expiration

Sending text file to Jenkins via remote trigger - from excel (VBA)

I have a job in Jenkins that accepts a text file parameter.
Builds are triggered from an excel macro - and I'm having difficulty understanding how to send the file to Jenkins.
Up until now, what I understood is the following:
the file must be sent in an HTTP POST request, in the body.
the file must be sent in multipart/form-data format.
What I can't seem to manage to find out:
how exactly do I encode my file to multipart/form-data in VBA?
how do I send multiple files to Jenkins in the same HTTP POST request?
More information that might be helpful:
I'm using MSXML2.XMLHTTP60.
The job has other parameters (string, password), so I'm using the format:
http://server/job/myjob/buildWithParameters?PARAM1=Value1&PARAM2=Value2
Thank you in advance for any help.
EDIT:
After a lot of headeache, I discovered that currently, the option of sending a file parameter via an http POST request is not supported:
https://issues.jenkins-ci.org/browse/JENKINS-56169
But it has been opened as a new feature request.
The only option is pretending to be the web browser, and sending an http POST request identical to the one the Jenkins server is expecting to receive.
This poses the problem I described in the Jenkins Issue - the server's response doesn't contain the item's location in the queue.

Get file behind html form

I have a file I want to download. The file is secured with a html form:
Login Screen
I want to download the following URL to the Payload: https://10.10.0.18/history/information.csv
What function do I use in Mule and is it even possible?
For Basic authentication with only username and password, you can use HTTP request connector followed by a file outbound endpoint
Refer :- https://developer.mulesoft.com/docs/display/current/Authentication+in+HTTP+Requests
https://developer.mulesoft.com/docs/display/current/Authentication+in+HTTP+Requests#AuthenticationinHTTPRequests-basic
You can also look the following reference :- Mule ESB download file from URL string

Viewing pentaho dashboard outside pentaho

I have created a dashboard in pentaho User console. I want to view it outside the User console.(Without logging in to user console) Is it possible ?
Yes. It is possible.
You need get two things.
1)Get URL for the dashboard
2)Allow URL authentication.
1)Dashboard URL
---------------
The dashboard url structure will be like this.
http://localhost:8080/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=RootDirectoryName&path=SubDirectoryName&file=your_dashboard.wcdf&userid=admin&password=password
if you have directory structure like this in your pentaho
-
Home
---->Admin
---->Suzy
---->tiffiny
Public
----->myDashBoard
----------->myDashboard.wcdf
----->SampleDashBoard
----->.....
----->.....etc
Public and Home are root directories, and Suzy,SampleDashBoard are sub Directories.
Example if you want to use myDashboard.wcdf dashboard then you use this link.
http://localhost:8080/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=home&path=suzy&file=iq_dashboard.wcdf&userid=admin&password=password
------------------------------------------------------------------------
2)Allowing URL Authentication
go to your pentaho directory ex:- **
D:\yourDirectory\pentaho-server-ce-7.0.0.0-25\pentaho-server\pentaho-solutions\system\
------------------------------------------------------------------------
**
open security.properties file in editor.
security.properties
change this code from false to true.
requestParameterAuthenticationEnabled=true
------------------------------------------
>save file and close it.
>restart pentaho server.
>Open your browser and enter the dashboard link as generated in step 1.
>Now your dashboard will render on browser.
------------------------------------------------------------------------
If your dashboard was created with the CDE, you can embedded it in your web applications in three ways:
Enabling the requireJS flag in settings within the CDE and embedding the same via a rendering plugin.
Using iframe and calling the dashboard link passing authentication via URL.
Using the components of the CDF and placing in the code of your application.
You can choose the best way according your requirements.
Yes and no : If you double-click on the tab (here, I mean the tab inside the PUC) of your dashboard, the PUC will ask you if you want to open it in a tab of your browser. Answer yes and then you get your dashboard in a tab. The url ens with something like ' generatedcontent/ts=...' : copy it up toand including 'generatedcontent' : you can now directly see the dashboard BUT an authentification is still required
To achieve this you first have:
Double click the dashboard to open it in a new tab in the browser, copy the entire url including the ts
Activate url authentication on the server activing url autentication
Access the link, which you copied in step 1 by adding the following to the end &userid=YOUR_USER&password=YOUR_PASSWORD
Another way to do this is configuring pentaho with cas Switch to Central Authentication Service (CAS)
I hope I help you