|
Hi,
When I try to use Spring 3 RestTemplate to call Artifactory REST API I always get 406 (Not Acceptable) even though I have Apache Commons HttpClient set with credentials. When I use HttpClient directly it works. Is there anybody else who experienced similar issue with Spring 3 RestTemplate? I suspect it is buggy .. Also, is there a way to configure Artifactory so that anonymous user can invoke any REST call without sending credentials? It didn't work for me even after I provided it a "delete" permissions. I understand it is a security bridge but it would be nice to disable a "privileged user" REST requirement just for a while. Thank you! |
|
Also, from 3 password versions, which one can I send with REST calls?
* Plain text * Encrypted password that can be stored in "settings.xml" * MD5 of password that is available in the Admin => Advanced => Security Descriptor Seems to me like the first two but I'd like to be sure. Thank you! |
|
In reply to this post by Evgeny Goldin
On Mon, Jun 28, 2010 at 8:55 PM, Evgeny Goldin <[hidden email]> wrote:
I believe the Spring queries set a content-type header that is not accepted by Artifactory's REST API and that's why you get a 406. Can you check with one method that fails and let us know which one and what was the content type value?
Are you trying to issue a DELETE query as anonymous? If you gave the anonymous user delete rights then it should work and it looks like a bug - feel free to open an issue.
------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Artifactory-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/artifactory-users |
|
In reply to this post by Evgeny Goldin
Your guess is good ;)
For encrypted password you need to have the password policy 'support' or 'require' encrypted password - note that in the later case you will not be able to send clear text. On Mon, Jun 28, 2010 at 11:25 PM, Evgeny Goldin <[hidden email]> wrote:
------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Artifactory-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/artifactory-users |
|
In reply to this post by Yoav Landman
Ok, I'll check it tomorrow evening or day after tomorrow. No, I was issuing a simple "/api/storage/{repoName}/{groupId}/{artifactId}" request to get a folder metadata, trying to see the latest version available. Yes, anonymous user has all rights, except "admin". I'll check it again and will open a bug with a dump of HTTP headers. |
|
In reply to this post by Yoav Landman
Just posted the credentials question to the Spring forum as well:
http://forum.springsource.org/showthread.php?t=91471 |
|
The issue is most likely about wrong content-type - not bad credentials.
On Mon, Jun 28, 2010 at 11:49 PM, Evgeny Goldin <[hidden email]> wrote:
------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Artifactory-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/artifactory-users |
|
In reply to this post by Evgeny Goldin
Thinking about ti again .. I think I wasn't sending an anonymous request, I was sending credentialed request. I'll try again a pure anonymous one. |
|
In reply to this post by Yoav Landman
The only diff between sending HTTP request with low-level HttpClient (that works) and using RestTemplate (that returns 406) I see now is that RestTemplate sends "Accept: text/plain, */*\r\n" while Http Client doesn't send this header. Will try to play with it ...
|
requestHeaders.set( "Accept", "*/*" ) ("application/json" didn't work)
This one works:
HttpHeaders requestHeaders = new HttpHeaders(); requestHeaders.set( "Accept", "*/*" ); HttpEntity> requestEntity = new HttpEntity( requestHeaders ); HttpEntity |
|
And it had nothing to do with credentials, it works now without sending them at all, our "anonymous" user has permissions to do so.
I'll deals with credentials later |
|
Please track http://issues.jfrog.org/jira/browse/RTFACT-3330 which is about accepting application/json.
On Thu, Jul 1, 2010 at 6:00 PM, Evgeny Goldin <[hidden email]> wrote:
------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Artifactory-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/artifactory-users |
|
Ok, thank you!
|
| Powered by Nabble | See how NAML generates this page |
