<div dir="ltr"><div>Hi;</div><div><br></div><div>I am reading the REST API Guide, it's the first time that I am testing this.</div><div><br></div><div>I have hard time to use OAuth authentication to make queries.</div><div><br></div><div>I can get the token with curl and with a firefox REST module</div><div><b>curl --cacert ca.crt -X POST -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: application/json' -d 'grant_type=password&scope=ovirt-appapi&username=admin%40internal&password=mypass' <a href="https://engine101.example.com/ovirt-engine/sso/oauth/token">https://engine101.example.com/ovirt-engine/sso/oauth/token</a> HTTP/1.1</b></div><div><br></div><div>engine log :<br></div><div>[org.ovirt.engine.core.sso.utils.AuthenticationUtils] (default task-1) [] User admin@internal successfully logged in with scopes: ovirt-appapi<br></div><div><br></div><div><br></div><div>But when I try to use it I get this error :</div><div><b>curl --cacert ca.crt -X GET -H 'application/xml' -H 'Authorization: Bearer fT0knxah-wEOyi-VdhmozKv-hz-wohVm268BBJts-MYxNZ548K0UZCSmv5nY18Z6gPiFdl-VAySjqr_N4gPGAA' <a href="https://engine101.example.com/ovirt-engine/api/vms">https://engine101.example.com/ovirt-engine/api/vms</a> HTTP/1.1</b></div><div><br></div><div>engine log:<br></div><div>ERROR [org.ovirt.engine.core.aaa.filters.SsoRestApiAuthFilter] (default
task-30) [] Cannot authenticate using authentication Headers: The
required scope ovirt-app-api is not granted.</div><div><br></div><div>With basic authentication, it's working, so I don't know where is the problem.<br></div><div><br></div>Regards.<br><div id="gmail-m_8952078234548713351DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid rgb(211,212,222)">
        <tbody><tr>
<td style="width:55px;padding-top:18px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" style="width: 46px; height: 29px;" width="46" height="29"></a></td>
                <td style="width:470px;padding-top:17px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Garanti sans virus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" style="color:rgb(68,83,234)" target="_blank">www.avast.com</a>                 </td>
        </tr>
</tbody></table>
<a href="#m_8952078234548713351_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div></div>