Oauth identity toolkit - java

I am at last step to configure the identity tool kit login authentication , so they talk about configure server side " There are two code snippets at the bottom of the page. The first snippet helps make the JavaScript configuration easy for your website. The second snippet should be saved in your server side code directory as gitkit-server-config.json.
The server side configuration file needs to be further configured before use. Open the file for editing and change serviceAccountPrivateKeyFile setting to be equal to the path of the *.p12 or *.json file you downloaded earlier. You should use the full path, beginning with / and ending with the full name of the *.p12 or *.json file" can any one help me

Related

JSP c:import giving java.net.SocketException when using short name alias

I have a Java web app which has a JSP page which has a couple c:import lines in it. The content referenced is on the same web server as the Java app, but is not bundled in the war file. My site has dns entries to allow for access to this app from a browser with a full name https://abc.123.def.com/app or a short name of just https://abc/app for users on our network.
If I access the jsp page via the alias https://abc/app I can get to the jsp page in the browser, but I get a server exception Problem accessing the absolute URL "https://abc//webfiles/included_file.html". java.net.SocketException: Connection reset on the page. But, when I access the jsp page via the fqdn like https://abc.123.def.com/app the include works perfectly, the jsp compiles, and all is well.
If I put the address of the file to be included in my browser it works with either short name or fqdn. So even though the error is saying the JSP can't find the file https://abc//webfiles/included_file.html I can plug that address in my browser and get to it fine. That's true from my separate user machine, or from a browser on the server itself. (Yes I see that double // there, it seems to not be a problem, it loads in the browser and loads fine as an include when using the fqdn).
I have good reason to believe the code is fine, this code worked fine on my old server which had JBoss 5. We've moved it to JBoss 6.4 on a new server and are now encountering this alias/short name include problem. I'm thinking it's some JBoss or IIS configuration issue. Of course we have lots of external links to this application utilizing the short name so simply using the fqdn will not work.
So IIS can serve up both the jsp via a fqdn or short name, it can also serve up the included_file path using the fqdn or short name. But Java for some reason can't see that included_file when using the short name, only the fqdn.
I've confirmed that the DNS suffix search list in the server's ipconfig includes the domain the site is in.
I'm not a JBoss config admin, and have no experience with IIS really, just a developer of the app, but I've been thrust into JBoss config/debugging out of desperation. Any help much appreciated.

Apache jMeter is not generating ApacheJMeterTemporaryRootCA.crt certificate for http request recording

I'm following step by step this tutorial to create the certificate ApacheJMeterTemporaryRootCA.crt.
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
However after I hit run nothing related to certificate is showing up, as if I was just running a simple test without recording. It's not even displaying error messages. I have read these threads but they are not helpful for my case:
Does any
- Apache jMeter not generating ApacheJMeterTemporaryRootCA.crt for https recording
- ApacheJMeterTemporaryRootCA.crt not generated
I am using Java 1.7.0,67, Jmeter 2.13 (both are newest versions). I have also followed this page to set up my environment variables
https://wiki.apache.org/jmeter/TestRecording210
Does anyone has an idea about what is missing here?
Thanks a million!!
I had a problem where I'd deleted the certificate and struggled to get it to regenerate.
In the bin folder there is a keystore file called proxyserver.jks, when I deleted that the certificate regenerated on the next start of the test script recorder
In the absolute majority of cases jmeter.log file contains all the answers or at least can help to figure out the cause of the problem.
If below checklist doesn't help - update your question with relevant bit of the JMeter log file.
Use JDK, not JRE
Make sure that you have the following environment variables set:
JAVA_HOME - pointing to JDK installation root
PATH - contains /bin folder of JAVA_HOME
If you using web browser for recording make sure that
"HTTP Proxy" is set to correct JMeter host and port
"Use proxy for all protocols" box is checked
"No proxy for" input doesn't filter out JMeter host (you can clean it)
Refer below image for example proxy settings for Firefox browser:
The easiest way to set up JMeter for recording is using Recording Template (File -> Templates -> Recording), this way you can get JMeter configured for recording in a single click
If above checklist didn't resolve your problem check out Recording HTTPS Traffic with JMeter's Proxy Server guide for troubleshooting tips.
Navigate to HTTP(S) Test Script Recorder, and click the Start button at the bottom.
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
This will start the JMeter proxy server which is used to intercept the browser requests.
A file called ApacheJMeterTemporaryRootCA.crt will be generated in jmeter/bin folder.
Possibly you run test instead of starting proxy server.

servlet - choosing the file to download on clicking a link

The scenario is like : I have a page on which when we submit a file number, the client is given a link to download the file. But I don't know how to write one servlet which will decide which file to send to the client. This has to happen on clicking of a link, so I can't send parameters which can help me determine which file to download.
Please help.
you submit a file number;
you build a link based on that file number (it's a link for a GET. GET can have parameters, so you can put parameters in the URL path or in the query string);
user clicks the link;
the link is handled by a servlet;
the servlet uses the parameters from the GET request to determine what file to send;
you send the content of that file in the response.
Those are the steps.
Here is an example on BalusC's blog: http://balusc.blogspot.ro/2007/07/fileservlet.html
What you need to take care of is security:
don't expose the file directly as path on the server otherwise users can navigate the path to access other files on your application;
if users of your application have different rights, make sure you check those rights before returning the file, so that you a user can't access somebody else's files.

Glassfish increase maxParameterCount

We have a page on an application deployed in Glassfish 3.1.2.2 that has over 10,000 fields (both hidden and displayed) that get submitted to the server. When the page is submitted, the server logs spit out:
WARNING: More than the maximum number of request parameters (GET plus POST) for a single request([10,000]) were detected. Any parameters beyond this limit have been ignored. To change this limit, set the maxParameterCount attribute on the Connector.
I've seen other posts on increasing it for JBoss using a system property on startup, but that doesn't work here. I've also tried setting that property on various connector XML attributes in domain.xml without any success, nor have I been able to find any UI control in the admin where that would be set.
I'm going to put the answer here for public knowledge, but it was someone else who I know who figured it out:
I changed web-core.jar to be web-core.zip and then opened the zip and went into the org/apache/catalina/connector folder. I extracted the Connector.class file and opened it in a hex editor, searched for 0x2710 (10,000) and changed it to 0xFFFF (-1) Then I copied the Connector.class back into the zip file and renamed back to .jar
I also opened the jar with java-decompiler to verify that the java code did actually look correct after manually editing the class file.

java tomcat links generated don't work

I'm just doing a java tomcat project, that does some query in a database then return the file path of some web pages.
Now I have mapped my only class in web.xml and the webapp does return a list of urls which correspond to some html pages in my local disk. I set up a side frame in the webapp, my idea is that I output the results in the output page like "file:///file_path_of_html_page" and when this link is clicked, the side frame will show the html page.
But actually I got the right links but when I click on them, nothing happens, chrome tells me "Not allowed to load local resource". Even I set the target="_blank", the link doesn't work. But the "file:///filepath" are all ok when I type them in the address bar. I've moved all the html pages in the eclipse project folder but that didn't help.
Any suggestions to do this simple task?
The average browser disallows due to security reasons opening file:// resources when the parent resource is by itself served over http://. If you make them fullworthy http:// links, then it will work properly.
Even if the browser allowed it, this approach would not going to work when you publish the webapp on a different server. A file:// resource refers to the local disk file system, which is the one the client (the user with the webbrowser) is using. This is normally in a physically different machine. The client should have a copy of exactly those resources on its own local disk file system beforehand in order to get the file:// links to work.
Just put the HTML pages in public web root of your web project (there where you normally put your JSP files and so on) and use (relative) http:// links to refer the HTML pages. For example, the following link in a http://localhost:8080/contextname/some.jsp
link to some html file
would open the http://localhost:8080/contextname/some.html file.

Categories