VMware {code} Community
AlexeyKravtsov2
Contributor
Contributor

ListAllvApps authentification problem

Hi,

I am trying  to run example ListAllvApps

I am passing url as "https://172.31.105.206/api/v1.0/login"

version "1.0"

my login@organization

and password

But I am getting these error at

vcloudClient.getSupportedVersions()

Jul 25, 2011 4:26:51 PM com.vmware.vcloud.sdk.RestUtil getSupportedVersions

INFO: GET: URL https://172.31.105.206/api/v1.0/login

Jul 25, 2011 4:26:55 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme

INFO: basic authentication scheme selected

Jul 25, 2011 4:26:55 PM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge

INFO: No credentials available for BASIC 'vCloud'@172.31.105.206:443

Jul 25, 2011 4:26:55 PM com.vmware.vcloud.sdk.RestUtil getSupportedVersions

INFO: GET: status Code: 401

Jul 25, 2011 4:26:55 PM com.vmware.vcloud.sdk.RestUtil getSupportedVersions

INFO: Status Line: HTTP/1.1 401 Unauthorized

Jul 25, 2011 4:26:55 PM com.vmware.vcloud.sdk.RestUtil getSupportedVersions

INFO: Response :

Jul 25, 2011 4:26:55 PM com.vmware.vcloud.sdk.Response isExpected

INFO: Expected Status Code: 200

Jul 25, 2011 4:26:55 PM com.vmware.vcloud.sdk.Response isExpected

INFO: Actual Status Code: 401

Reply
0 Kudos
4 Replies
rkamal
VMware Employee
VMware Employee

Hi,

Kindly pass the url as -  http://cloud/api/versions

Regards,

Rajesh Kamal.

Reply
0 Kudos
AlexeyKravtsov2
Contributor
Contributor

if I pass it as

VcloudClient vcloudClient = new VcloudClient(https://172.31.105.206/api/v1.0);

I am getting these errors

Jul 25, 2011 4:36:31 PM com.vmware.vcloud.sdk.RestUtil getSupportedVersions

INFO: GET: URL https://172.31.105.206/api/v1.0

Jul 25, 2011 4:36:36 PM com.vmware.vcloud.sdk.RestUtil getSupportedVersions

INFO: GET: status Code: 403

Jul 25, 2011 4:36:36 PM com.vmware.vcloud.sdk.RestUtil getSupportedVersions

INFO: Status Line: HTTP/1.1 403 Forbidden

Jul 25, 2011 4:36:37 PM com.vmware.vcloud.sdk.RestUtil getSupportedVersions

INFO: Response :

<?xml version="1.0" encoding="UTF-8"?>

<Error xmlns="http://www.vmware.com/vcloud/v1"

stackTrace="com.vmware.vcloud.api.rest.handlers.exceptions.UnauthorizedAccessRestApiException

: Access is forbidden

at com.vmware.vcloud.api.rest.handlers.ErrorHandler.getUnauthorizedRestApiException(

ErrorHandler.java:74)

...

at org.mortbay.thread.BoundedThreadPool$PoolThread.run(

BoundedThreadPool.java:451)

" minorErrorCode="ACCESS_TO_RESOURCE_IS_FORBIDDEN" message="Access is forbidden" majorErrorCode="403" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1 http://172.31.105.206/api/v1.0/schema/master.xsd"></Error>

Jul 25, 2011 4:36:37 PM com.vmware.vcloud.sdk.Response isExpected

INFO: Expected Status Code: 200

Jul 25, 2011 4:36:37 PM com.vmware.vcloud.sdk.Response isExpected

INFO: Actual Status Code: 403

Reply
0 Kudos
rkamal
VMware Employee
VMware Employee

Hi,

VcloudClient vcloudClient = new VcloudClient(https://172.31.105.206/api/v1.0);

Should be,

     VcloudClient vcloudClient = new VcloudClient(https://172.31.105.206/api/versions);

     The VcloudClient expects the versions url and not the login url.

Regards,

Rajesh Kamal.

AlexeyKravtsov2
Contributor
Contributor

Thank you.

it helped.

Reply
0 Kudos