Re: [ovirt-users] testing REST API

2017-08-19 Thread Ondra Machacek
On Fri, Aug 18, 2017 at 11:38 PM, wodel youchi  wrote:
>
> Hi;
>
> I am reading the REST API Guide, it's the first time that I am testing this.
>
> I have hard time to use OAuth authentication to make queries.
>
> I can get the token with curl and with a firefox REST module
> curl --cacert ca.crt -X POST -H 'Content-Type: 
> application/x-www-form-urlencoded' -H 'Accept: application/json' -d 
> 'grant_type=password=ovirt-appapi=admin%40internal=mypass'
>  https://engine101.example.com/ovirt-engine/sso/oauth/token HTTP/1.1

You have incorrect scope. You have ovirt-appapi , but it should be ovirt-app-api

>
>
> engine log :
> [org.ovirt.engine.core.sso.utils.AuthenticationUtils] (default task-1) [] 
> User admin@internal successfully logged in with scopes: ovirt-appapi
>
>
> But when I try to use it I get this error :
> curl --cacert ca.crt -X GET  -H 'application/xml' -H 'Authorization: Bearer 
> fT0knxah-wEOyi-VdhmozKv-hz-wohVm268BBJts-MYxNZ548K0UZCSmv5nY18Z6gPiFdl-VAySjqr_N4gPGAA'
>https://engine101.example.com/ovirt-engine/api/vms HTTP/1.1
>
> engine log:
> 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.
>
> With basic authentication, it's working, so I don't know where is the problem.
>
> Regards.
>
> Garanti sans virus. www.avast.com
>
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] testing REST API

2017-08-18 Thread wodel youchi
Hi;

I am reading the REST API Guide, it's the first time that I am testing this.

I have hard time to use OAuth authentication to make queries.

I can get the token with curl and with a firefox REST module
*curl --cacert ca.crt -X POST -H 'Content-Type:
application/x-www-form-urlencoded' -H 'Accept: application/json' -d
'grant_type=password=ovirt-appapi=admin%40internal=mypass'
https://engine101.example.com/ovirt-engine/sso/oauth/token
 HTTP/1.1*

engine log :
[org.ovirt.engine.core.sso.utils.AuthenticationUtils] (default task-1) []
User admin@internal successfully logged in with scopes: ovirt-appapi


But when I try to use it I get this error :
*curl --cacert ca.crt -X GET  -H 'application/xml' -H 'Authorization:
Bearer
fT0knxah-wEOyi-VdhmozKv-hz-wohVm268BBJts-MYxNZ548K0UZCSmv5nY18Z6gPiFdl-VAySjqr_N4gPGAA'
https://engine101.example.com/ovirt-engine/api/vms
 HTTP/1.1*

engine log:
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.

With basic authentication, it's working, so I don't know where is the
problem.

Regards.


Garanti
sans virus. www.avast.com

<#m_8952078234548713351_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users