Comments (10)
Not sure what you are asking. DO you want to know if you could find out whether JasperReports Server is accepting encrypted password at login? If that's the case you can send a request to /GetEncryptionKey servlet. If it comes back with an error, login encryption is off. Otherwise, it will send you a key.
from jrs-rest-java-client.
that's what i want. So will this api handle this case automatically? Does it provide some method to access GetEncryptionKey ?
from jrs-rest-java-client.
Not sure what api you are talking about. You just call host:port//GetEncryptionKey after you are authenticated. If a key is returned, the server expects encrypted password; otherwise, if an error is returned, login password encryption is turned off.
Dmitriy
-------- Original message --------
From: TestOverload [email protected]
Date: 02/22/2014 9:27 AM (GMT-06:00)
To: Jaspersoft/jrs-rest-java-client [email protected]
Cc: dilit [email protected]
Subject: Re: [jrs-rest-java-client] Is it possible to add api for password encryption when logging in jasper server (#1)
that's what i want. So will this api handle this case automatically? Does it provide some method to access GetEncryptionKey ?
—
Reply to this email directly or view it on GitHub.
from jrs-rest-java-client.
After turning on log-in password encryption in jasper server, i have tried to use jrs-rest-java-client to get a report from local jasperserver (like Code(1)), but it return status code 401 and no input stream return.
Also I have tried another raw method, using Jersey2 lib to access GetEncryptionKey to encrypt my password then log-in successfully. After setting a session id to cookie from a response when GetEncryptionKey, a report can be requested from jasperserver successfully.
So I guess the library jrs-rest-java-client may not check log-in password encryption is enabled in jasper server before log-in or executing a run like
OperationResult result = client
.authenticate("jasperadmin", "jasperadmin")
.reportingService()
.report("/reports/samples/Cascading_multi_select_report")
.prepareForRun(ReportOutputFormat.HTML, 1)
.parameter("Cascading_name_single_select", "A & U Stalker Telecommunications, Inc")
.run();
Code(1)
I want to use jrs-rest-java-client to do some operations. Since jasper server need session id to identity and maintain a connection, i have no idea to pass the session id to the library after log-in, Then my program cannot continue to get report....
So My question is how to fix this issue. Can this library handle this case?
Thanks
from jrs-rest-java-client.
run rest service call (old rest service, not rest_v2)
/rest/GetEncryptionKey - Get Public Key
Encript the password with algorithm:
public String getEncryptedPassword(PublicKey publicKey, String originalPassword) throws Exception {
Cipher enc = Cipher.getInstance("RSA/NONE/NoPadding");
//Encryption
enc.init(Cipher.ENCRYPT_MODE, publicKey);
String utfCePass = URLEncoder.encode(originalPassword, CharEncoding.UTF_8);
byte[] encryptedUtfCePass = enc.doFinal(utfCePass.getBytes());
return byteArrayToHexString(encryptedUtfCePass);
}
Put this encripted password to chain:
".authenticate"
GetEncryptionKey is not implemented in this rest java client library yet.
from jrs-rest-java-client.
Thanks for your response. I will try it.
from jrs-rest-java-client.
/rest/GetEncryptionKey should actually work even before authentication. Sending this request url to the server will tell you whether the server accepts encrypted or plain text passwords.
from jrs-rest-java-client.
Resolved
from jrs-rest-java-client.
I am stuck at this as for now. What i am not getting is. Do i have to write a service for it or i have to just enable the service in JasperServer and hit that?
from jrs-rest-java-client.
This library automatically encrypts your password before send it if encryption is on, so to authenticate you need just specify login and password (not encrypted) in authenticate() method.
I found in documentation sentence above. Please tern password encryption on (on a server) and try to use client as usually (with not encrypted password). It should work for you. If not - please reopen this issue.
from jrs-rest-java-client.
Related Issues (20)
- There is no JSESSIONID in the content of HTTP response after a bad request. HOT 2
- IllegalParameterValueException happens when there is a comma in the uri for Resources Service. HOT 1
- When getting data, in what situation will Bad Request occur ? HOT 1
- String index out of range: -14 HOT 1
- 400 Bad Request Create ClientSemanticLayerDataSource Domain HOT 1
- Unable to find contextual data of type: javax.ws.rs.ext.Providers at Autentication HOT 2
- Support for REST API dependsOn search parameter. HOT 1
- Build failure HOT 1
- TEXT Export for jrs-rest-java-client is not available HOT 1
- Support for this project? HOT 3
- Support to Jasper 7.1
- Support for jersey 2.27 HOT 2
- Read time out issue with JRS 7.1 server HOT 4
- Problem in exports object after reportExecution
- java.lang.NoClassDefFoundError: com/jaspersoft/jasperserver/jaxrs/client/providers/CustomRepresentationTypeProvider
- 生产自定义写的 jrxml ,出现bad request 问题
- Can't install maven dependency HOT 2
- still using log4j 1.2.17 HOT 1
- Missing Documentation For Uploading File Resources
- not compatible with spring boot 2.0.x and above
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jrs-rest-java-client.