<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 02/07/2014 04:33 AM, Alexandre
Santos wrote:<br>
</div>
<blockquote cite="mid:23C77966-58D0-4173-B14B-3130A66B2D3E@uc.pt"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hi Martin,
<div><br>
</div>
<div>I´ve tried your example and i get this error:</div>
<div><br>
</div>
<div>
<div>curl -v \</div>
<div> -H "Content-Type:application/json" \</div>
<div> -H "Accept:applicaton/json"\</div>
<div> --negotiate -u : \</div>
<div> --delegation always \</div>
<div> --cacert /etc/ipa/ca.crt \</div>
<div> -d
'{"method":"user_find","params":[[""],{}],"id":0}' \</div>
<div> -X POST <a moz-do-not-send="true"
href="https://ipa/ipa/json">https://ipa/ipa/json</a></div>
</div>
<div><br>
</div>
<div>...</div>
<div><br>
</div>
<div>> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu)
libcurl/7.19.7 NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2<br>
> Host: pi<br>
> Content-Type:application/json<br>
> Accept:applicaton/json<br>
> Content-Length: 48<br>
> <br>
< HTTP/1.1 200 Success<br>
< Date: Thu, 06 Feb 2014 16:42:26 GMT<br>
< Server: Apache/2.2.15 (CentOS)<br>
< Connection: close<br>
< Transfer-Encoding: chunked<br>
< Content-Type: application/json; charset=utf-8<br>
< <br>
{<br>
"error": {<br>
"code": 911, <br>
"message": "Missing or invalid HTTP Referer, missing", <br>
"name": {<br>
"__base64__": "UmVmZXJlckVycm9y"<br>
}<br>
}, <br>
"id": null, <br>
"principal": “admin@ipa", <br>
"result": null, <br>
"version": "3.0.0"<br>
* Closing connection #0<br>
<br>
</div>
<div>
<div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse:
separate; border-spacing: 0px;"><span
class="Apple-style-span" style="border-collapse: separate;
color: rgb(0, 0, 0); font-family: Helvetica; font-style:
normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; "><font class="Apple-style-span" face="Arial"><span
class="Apple-style-span" style="border-collapse:
separate; font-variant: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-align:
-webkit-auto; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space; "><span
class="Apple-style-span" style="border-collapse:
separate; font-variant: normal; letter-spacing:
normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows:
2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word;
-webkit-nbsp-mode: space; -webkit-line-break:
after-white-space; "><span
class="Apple-style-span"
style="border-collapse: separate;
font-variant: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-align:
-webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word;
-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space; "><span
class="Apple-style-span"
style="border-collapse: separate;
font-variant: normal; letter-spacing:
normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent:
0px; text-transform: none; white-space:
normal; widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word;
-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space; ">
<div>
<div><br>
</div>
<div>Any suggestion?</div>
</div>
</div>
</span></div>
</span></div>
</span></div>
</span></font></span></span></div>
</div>
</blockquote>
That is the CSRF check.<br>
<br>
Explicitly set the referrer header to the same URL as the web server
and you should be OK<br>
<br>
<blockquote cite="mid:23C77966-58D0-4173-B14B-3130A66B2D3E@uc.pt"
type="cite">
<div>
<div apple-content-edited="true"><span class="Apple-style-span"
style="border-collapse: separate; border-spacing: 0px;"><span
class="Apple-style-span" style="border-collapse: separate;
color: rgb(0, 0, 0); font-family: Helvetica; font-style:
normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; "><font class="Apple-style-span" face="Arial"><span
class="Apple-style-span" style="border-collapse:
separate; font-variant: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-align:
-webkit-auto; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space; "><span
class="Apple-style-span" style="border-collapse:
separate; font-variant: normal; letter-spacing:
normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows:
2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word;
-webkit-nbsp-mode: space; -webkit-line-break:
after-white-space; "><span
class="Apple-style-span"
style="border-collapse: separate;
font-variant: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-align:
-webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word;
-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space; "><span
class="Apple-style-span"
style="border-collapse: separate;
font-variant: normal; letter-spacing:
normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent:
0px; text-transform: none; white-space:
normal; widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word;
-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space; ">
<div><br>
</div>
</div>
</span></div>
</span></div>
</span></div>
</span>Alexandre Santos</font>
<div style="color: rgb(0, 0, 0); font-family: Helvetica;
font-weight: normal; font-style: normal; "><br>
</div>
</span></span></div>
<div>
<div>On 06 Feb 2014, at 15:12, Martin Kosek <<a
moz-do-not-send="true" href="mailto:mkosek@redhat.com">mkosek@redhat.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">As Petr said, we do not have a proper
documentation for using RPC for<br>
controlling IPA. But I think you can start with looking at
[1] to see the<br>
template and try running our commands with "-vv" which will
show you how we<br>
call the API:<br>
<br>
$ ipa -vv user-show admin<br>
<br>
Martin<br>
<br>
[1] <a moz-do-not-send="true"
href="http://adam.younglogic.com/2010/07/talking-to-freeipa-json-web-api-via-curl/">http://adam.younglogic.com/2010/07/talking-to-freeipa-json-web-api-via-curl/</a><br>
<br>
On 02/06/2014 04:04 PM, Alexandre Santos wrote:<br>
<blockquote type="cite"><br>
Is there any examples that can guide me.<br>
<br>
Thanks<br>
Alexandre Santos<br>
<br>
On 06 Feb 2014, at 14:33, Petr Vobornik <<a
moz-do-not-send="true" href="mailto:pvoborni@redhat.com">pvoborni@redhat.com</a>>
wrote:<br>
<br>
<blockquote type="cite">On 6.2.2014 15:22, Alexandre
Santos wrote:<br>
<blockquote type="cite">Hi,<br>
<br>
I´m starting in freeIPA and I would like to know what
web apps are available for use, like create user,
delete user and so on. I´ve seen that when i use the
command "ipa -vv user-add” a url for the app if given.<br>
<br>
I would like to know if there is any information about
that.<br>
<br>
Thanks<br>
<br>
Alexandre Santos<br>
<br>
</blockquote>
<br>
The url you saw is most-likely for XML RPC API.<br>
<br>
You can check:<br>
<br>
<a moz-do-not-send="true"
href="https://hostname/ipa/xml">https://hostname/ipa/xml</a>
- XML RPC API<br>
<a moz-do-not-send="true"
href="https://hostname/ipa/json">https://hostname/ipa/json</a>
- JSON RPC API<br>
<a moz-do-not-send="true"
href="https://hostname/ipa/session/xml">https://hostname/ipa/session/xml</a>
XML RPC API with session support<br>
<a moz-do-not-send="true"
href="https://hostname/ipa/session/json">https://hostname/ipa/session/json</a>
JSON RPC API with session support<br>
<a moz-do-not-send="true" href="https://hostname/ipa/ui">https://hostname/ipa/ui</a>
- Web UI<br>
<a moz-do-not-send="true"
href="https://hostname/ipa/config/unauthorized.html">https://hostname/ipa/config/unauthorized.html</a>
- some config and error pages<br>
<br>
We don't have docs for the APIs yet.<br>
-- <br>
Petr Vobornik<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Freeipa-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Freeipa-devel@redhat.com">Freeipa-devel@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/freeipa-devel">https://www.redhat.com/mailman/listinfo/freeipa-devel</a></pre>
</blockquote>
<br>
</body>
</html>