Access to the VCO rest api vsphere Client Web plugin

Hello

I want access to vco rest api vsphere Web Client plugin. I know I can find key holder in UserSession object but I failed generate the Authorization (especially the signature part) header. I'm trying to generate the authorization as described in the message header . But still get the signature verification failed. I can't use java sdk to rest because the user credentials not available for the plugin.

Could someone help?

Hello

Here are a few snippets of the existing plugin that communicates with the vCO using the REST API.

Please let me know if that is enough or you need something more.

import java.security.PrivateKey;
import com.vmware.vim.sso.http.AuthCalculator;
import com.vmware.vim.sso.http.AuthCalculatorFactory;
import com.vmware.vim.sso.http.SignatureAlgorithm;
import com.vmware.vise.vim.security.sso.SsoService;

httpRequest.addHeader("Accept-Language", locale.toString().replace('_', '-'));  // Not sure if this is related

PrivateKey keyPair = ssoService.getHokPrivateKey();  // You should have this already
SamlToken samlToken = ... // You should have this already
String currentToken = samlToken.toXml();

String[] token = null;
if (keyPair != null && currentToken != null) {
   AuthCalculator calc = AuthCalculatorFactory.instance(SignatureAlgorithm.RSA_SHA256);
   token = calc.computeToken(request, keyPair, currentToken);
}

if (token != null) {
   for (int i = 0; i < token.length; i++) {
      httpRequest.addHeader("Authorization", token[i]);
   }
}

Try it and let me know if you have any questions.

Tags: VMware

Similar Questions

  • Suite of spring and vSphere Client Web plugins

    Hi, I'm new to this environment.  I'm developing VMware vSphere Client Web plugins.  Installing vSphere Web Client plugins, it is stated that favorite tools include Suite of spring, which is a derivative of the eclipse.  It is an optional component to use the tool, FlashBuilder.  Eventually, the VMware documentation states that you can use Eclipse instead of the spring tool Suite, but different configuration is necessary.

    I write here (instead of VMware/AST) for the following reasons.  I am able to set up the environment without the tool, FlashBuilder.  I am able to develop plugins Web Client without the tool, FlashBuilder.  However, I believe that the FlashBuilder tool will facilitate the development.  When I try to get the FlashBuilder to load, I get no longer things to work; I can't develop plugins Web Client.  Finally, the FlashBuilder tool is the only piece of the puzzle that is a licensed product, and therefore, I won't be able to buy the product if I can't get the trial version to work.

    FlashBuilder has an installer of plugin for Eclipse.  I tried to install the plugin following spring tools, and I tried to install the plugin in a regular version of the eclipse.  In both cases, the problem I encounter is that I cannot locate VMware files and does not have the Virgin service which is present when I didn't have the plugin installed FlashBuilder.

    Someone has no experience or knowledge in FlashBuilder getting to work in this type of installation?  Clearly, it's doable, but using all the documents that I can find online, I can't FlashBuilder work in my environment.

    Thanks for any help or suggestion you may have.

    You should post questions Flash Builder Flash Builder Forum.

    http://forums.Adobe.com/community/flash_builder?view=discussions

  • Error when querying the vCO REST API

    I have tries to interrogate vCO for a list of names of workflow but hit problems.  I do a GET request to the following URL by using a client of REST easy:

    https://VCO.domain.local:8281/api/workflows? key = name & maxResult = 5

    Request headers:

    Accept: application/json;v=5.1.1

    Content-Type: application/json;v=5.1.1

    Authorization: Basic 8s7f6s8f698s6f87s68f7 =

    Connection: keep-alive

    Origin: chrome extension: //rest-console-id

    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36 Chrome/30.0.1599.69

    I get the answer next, followed by a stack dump:

    < html > < head > < title > JBossWeb/2.0.1.GA - error report < / title > < style > <!-H1 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76; do-size: 22px ;}} H2 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76; do-size: 16px ;}} H3 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76; do-size: 14px ;}} BODY {do-family: Tahoma, Arial, without serif; color: black; background-color: white ;}} B {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76 ;}} P {do-family: Tahoma, Arial, without serif;: white background; color: black; do-size: 12px ;}} A {color: black ;}} B.SID {color: black ;}} HR {color: # 525 76 ;} - > < / style > < / head > < body > < h1 > State HTTP 500 - < / h1 > < HR size = "1" = "noshade" noshade > < p > < b > enter < /b > < /p > < p > < b > report Exception message < /b > < u > < / u > < / p > < p > < b > description < /b > < u > the server has} encountered an internal error () that prevented from fulfilling this request. < /u > < / p > < p > < b > exception < /b > < pre > org.springframework.web.util.NestedServletException: processing of the query failed. nested exception is java.lang.NullPointerException

    HOWEVER, the next request will be return 5 ID workflow as expected, only change being the key request parameter.  Any ideas on what I am doing wrong?

    https://VCO.domain.local:8281/api/workflows? key = id & maxResult = 5

    Just checked the source and it seems that when using "keys" to filter the returned properties must always include "id".

    Defining the two should work ? key = name & key = id

    https://vco.domain.local:8281/api/workflows? key = name & key = id & maxResult = 5?

    I'll open a bug and it will fix for the next version of update.

  • vRealize Operations Manager vSphere Client Web plugin does not work!

    Hi guys, I'm updating my environment Operations Manager vRealize and after that, I do not see the Web Client vSphere health status information. I followed the Migration to vRealize Operations Manager 6.0 Tutorial available in VMware Youtube channel and after change my TIME on the new server vRealize Operations Manager 6.0 Operations Manager 5.8 vCenter vCenter Operations Manager always direct plugin to my old Operations Manager vCenter VAPP environment.

    Error message:

    Unable to connect to the server vCenter operations. Check your network connection and the execution state of the virtual machines in the vCenter Operations Manager VAPP.

    Anyone know how to change the vCenter Operations Manager plugin to my new environment?

    Look at the screenshots to understand my problem.

    Thank you buddy. In fact, I had to do to solve the problem, but I removed the previous configuration before. I had to open https:///mob, locate the old configuration of Operations Manager 5.8 vCenter in content, ExtensionManager and UnregisterExtesion "com.vmware.vcops". After that, I did the same way as you have said and done! Thanks for your help.

  • How to change the display language for vsphere client from the web?

    Hi all

    I would like to know how to change the display language for vsphere client from the web?

    help please, thank you!

    Take a look at http://blogs.vmware.com/vsphere/2012/10/the-vsphere-web-client-and-localization.html to see which languages are available and how to change the URL.

    André

  • Server.getCredential () and vSphere client web 5.5.0b

    When connected customer orchestrator Server.getCredential () returns an object of the current user's credentials... However, if you run this method in a workflow from the web client, it does not seem to pass through and you end up with a null value.

    Anyone else see this issue?

    See you soon,.

    When you lo in vCO customer, you provide a user name and password, one internally, this is represented by an object of type UserToken

    When you run a workflow of vSphere Web Client, it calls the REST API of vCO not passing the name user and password, but token SSO - one object of type SamlToken. In this case, there is no available password so we cannot construct the appropriate UserToken object. That's why this particular API returns null.

    If you must pass the name of user and password to your technical workflow of customization and want to be able to invoke this workflow from vSphere Client Web - it is impossible to do, because there is no way to get the password of the user logged into vSphere Web Client. You can only get the user name.

  • Saving a vCenter Server in vSphere Client Web (5.5)

    Hello

    I was wondering if it is possible to save multiple vCenter servers (all vCenter Server devices) with a single instance of vSphere Web Client that runs on one of these devices to vCenter?

    VCSA1 > use built in Web Client to manage all vCenter servers.

    VCSA2 > register with VCSA1.

    VCSA3 > register with VCSA1.

    I find no 5.5 specific information but what I've read I think it's possible on 5.1. The ' admin - cmd.sh' script does not seem to be present in my 5.5 VCSA however.

    VSphere Documentation Centre

    The Server system, a device to vCenter Server vCenter is pre-recorded with the vSphere Client Web inside the unit. To register for another system of vCenter Server with the vSphere Client Web installed as part of a vCenter Server Appliance, you must use the admin-app script from the command line rather than the Web-based administration tool.

    vCenter Infrastructure Navigator 5.7 Documentation Center

    /usr/lib/VMware-vSphere-client/scripts/Admin-cmd.sh register https://WebClient.mydomain.com:9443 / vsphere client Director of VC.mydomain.com 'CENSORSHIP'

    Thanks for any help.

    The admin app is no longer available with vCenter 5.5. If you register all the vCSA to a SSo central, they will all see the place in the web client unique management this SSO Server vCenter.

  • you see only not lacp in vsphere client web

    I do not see the lacp seting in vsphere client of web

    http://KB.VMware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 2034277

    the WIS is 5.1 and the host is 5.1. vCenter is also 5.1

    Nevermind I found it now. Thank you

  • To access the vFoglight of in vSphere Client

    In regard to the video of the week "Accessing vFoglight go in vSphere Client" where the files that are mentioned in the video can be downloaded from?

    vfoglightplugin.XML and vsi.car

    A blogpost that contains the files can be found here: http://en.community.dell.com/techcenter/virtualization/infrastructure/b/storage-blog/archive/2012/03/06/integrating-vsphere-client-with-vfoglight

    Post edited by: Mattias Sundling

  • VSphere client web - Remote Console error: unable to connect to the connection of mks (name of user and password) incorrect

    Hello

    I am running vmware Fusion on my mac computer. I created a domain with 2 vm ESXI, VSPHERE client and a DC inside the merger. My mac is not inside the area, but can access the area through clearOS router which is also inside the virtual machine. my mac has IP 192.168.2.x and my management in the 10.0.0.x field segment

    When I try to access a virtual machine on my esxi from my mac, I get the error failed to connect to the connection of mks (name of user and password) incorrect. I guess it has something to do with my mac is not in the area, but no idea how I can solve this problem?

    Thank you

    solved by adding the ip address of my ESXI in my macs hosts file

  • create the document using the CMIS REST API

    Hello! I would like to integrate my java application with Oracle Webcenter via the REST API of CMIS. I can read, delete documents, but have some problem with creating one.

    I get success only when I create document (type = "/ ucmserver / IDC:GlobalProfile") with the name "idcPrimaryFile". In other cases I have the exception:

    oracle.webcenter.content.integration.RepositoryException: November 12, 2015 08:52:06 oracle.webcenter.content.integration.spi.ucm.DocumentManager mapBinaryPropertiesToTransferFile

    GRAVE: Impossible to perform the action on document with binary because the binary name and the name of the node must be the same, but they are not.  The binary name is XXX and the name of the file is idcPrimaryFile

    My properties:

    Properties =]

    (PropertyIds.OBJECT_TYPE_ID): type.

    (PropertyIds.NAME): name,.

    "/ ucmserver / IDC:GlobalProfile.ora:p:dDocType ':"Application. "

    ' / ucmserver / IDC:GlobalProfile.ora:p:dDocTitle ': 'Test ',.

    ' / ucmserver / IDC:GlobalProfile.ora:p:dSecurityGroup ': 'Public ',.

    ]

    I would appreciate help

    Hello! I solved my problem, but with a workaround.

    I will try to explain the problem and how it is possible to create documents via Oracle Webcenter Content Management API REST CMIS:

    For the next POST request:

    POST/rest/api/cmis/children/ucmserver? UID = IDC:Folder / FLD_USERS & versioningState = none HTTP/1.1

    Host: 192.168.32.192:8888

    User-Agent: Mozilla/5.0 (X 11; Linux x86_64; RV:38.0) Gecko/20100101 Firefox/38.0

    Accept-Encoding: gzip, deflate

    Connection: keep-alive

    Accept-Language: en-US, en; q = 0.5

    Content-Type: application/atom + xml; type = entry

    Cache-Control: no cache

    "http://www.w3.org/2005/Atom' xmlns:cmis ="http://docs.oasis-open.org/ns/cmis/core/200908/"xmlns:cmisra ="http://docs.oasis-open.org/ns/cmis/restatom/200908/"xmlns:chemistry ="http://chemistry.apache.org/">."

    urn: uuid:00000000 - 0000-0000-0000-00000000000

    test

    2015 11-13 T 08: 06:27.014Z

    a text

    Public

    test

    Application

    MyTitle

    / ucmserver / IDC:GlobalProfile

    I get the response from the server

    Error 500 - Internal server error

    oracle.webcenter.content.integration.RepositoryException: 18 November 2015 05:24:04 oracle.webcenter.content.integration.spi.ucm.DocumentManager mapBinaryPropertiesToTransferFile

    GRAVE: Impossible to perform the action on document with binary because the binary name and the name of the node must be the same, but they are not.  The binary name is test , and the name of the file is idcPrimaryFile.

    When the test is the document name.

    This request, I checked with an another compatible services of CMIS (IBM FileNet and OpenCMIS InMemory repository). I created the document with name test it.

    Workaround solution:

    POST request:

    POST/rest/api/cmis/children/ucmserver? UID = IDC:Folder / FLD_USERS & versioningState = none HTTP/1.1

    Host: 192.168.32.192:8888

    User-Agent: Mozilla/5.0 (X 11; Linux x86_64; RV:38.0) Gecko/20100101 Firefox/38.0

    Accept-Encoding: gzip, deflate

    Connection: keep-alive

    Accept-Language: en-US, en; q = 0.5

    Host: 192.168.32.192:8888

    Content-Type: application/atomsvc + xml

    Slug: test

    Cache-Control: no cache

    "http://www.w3.org/2005/Atom' xmlns:cmis ="http://docs.oasis-open.org/ns/cmis/core/200908/"xmlns:cmisra ="http://docs.oasis-open.org/ns/cmis/restatom/200908/"xmlns:chemistry ="http://chemistry.apache.org/">."

    urn: uuid:00000000 - 0000-0000-0000-00000000000

    test

    2015 11-13 T 08: 06:27.014Z

    a text

    Public

    test

    Application

    MyTitle

    / ucmserver / IDC:GlobalProfile

    I created the document with the name test in Oracle Webcenter.

    The differences between applications are:

    Content-Type: application/atomsvc + xml

    Slug: test

    So I'm not sure that the Oracle Webcenter Content Management Service STILL provides "correct" implementation of the OASIS CMIS specification, because I found nothing in therehttp://docs.oasis-open.org/cmis/CMIS/v1.0/cmis-spec-v1.0.html on the Slug query parameter and it is not clear to me how the Oracle Webcenter Content Management REST Service works with Content-type application/atom + xml; type = entry (I mean according to CMIS specification().



    It will be very useful for me to get another point of view. Maybe someone could correct me if I'm wrong.

    Thanks in advance.

  • Create the edge with the NSX REST API

    Hello

    I am trying to create a new benefit using the REST API, but I get the following error over and over again: the server has refused the request because the request entity is in a format not supported by the resource for the requested method.

    I use using a xml model provided by the nsx_61_api.pdf and all the "ids" settings are ok. Can anyone tell my what of wrong in my XML?

    I'm able to get a list of the existing edges using GET on https:// < nsxmgr-ip > /api/4.0/edges/

    In this case, I use the same URL, but with the post OFFICE instead. In the body, I put the following XML code.

    < edge >
    <datacenterMoid>datacenter-2</datacenterMoid>
        < name > MyName-Edge-01 < / name >
        < holding > Default < / holding >
    <vseLogLevelemergency</vseLogLevel> >
    <devices>
    <applianceSize>compact</applianceSize>
            < appliance >
    <resourcePoolId>resgroup-5050</resourcePoolId>
    <datastoreId>datastore-104</datastoreId>
            < / appliance >
        < / appliances >

        < vnics >
            < vnic >
                < index > 0 < / index >
                < name > uplink01 < / name >
                < type > uplink < / type >
    <portgroupId>virtualwire-10</portgroupId>
    <addressGroups>
                    < addressGroup >
    <primaryAddress>10.0.0.1</primaryAddress>
    <secondaryAddresses>
                            < ipAddress > 10.0.0.2 < / ipAddress >
                            < ipAddress > 10.0.0.3 < / ipAddress >
    <>of theipAddress10.0.0.4</> of theipAddress
    </secondaryAddresses>
    <subnetPrefixLength>29</subnetPrefixLength>
                    < / addressGroup >
                < / addressGroups >
                < MTU > 1600 < / MTU >
    <enableProxyArp>false</enableProxyArp>
    <enableSendRedirects>true</enableSendRedirects>
    <isConnected>true</isConnected>
    <inShapingPolicy>
    <averageBandwidth>20000000</averageBandwidth>
    <peakBandwidth>20000000</peakBandwidth>
    <burstSize>0</burstSize>
                    < enabled > true < / enabled >
                    < inherited > false < / inherited >
    </inShapingPolicy>
    <outShapingPolicy>
    <averageBandwidth>20000000</averageBandwidth>
    <peakBandwidth>20000000</peakBandwidth>
                    < burstSize > 0 < / burstSize >
                    < enabled > true < / enabled >
                    < inherited > false < / inherited >
    </outShapingPolicy>
            < / vnic >
        < / vnics >
    <cliSettings>
    <>theusernameadmin</> user name
    <password># 123456 PasssworD</> password
    <remoteAccess>true</remoteAccess>
        < / cliSettings >
    < / edge >


    Thank you very much

    D.

    Finally, I discovered.

    You must add the header without papers:

    XML:application / xml

    Don't ask me why this non-standard header is not documented.

    D.

  • vSphere Client Web - VM not found after add to the inventory

    Hello!

    We use device and Web Client Version 5.5.0 Build 1750785 vSphere vCenter.

    Machine virtual VM1 in the resource POOL1 pool configured on cluster1. DRS on in manual mode.

    I create user USER1 in AD with no privileges and allow it to turn on VM1. (User1 is a member of the Group GROUP1 and power on permission set GROUP1 POOL1 level.)

    Everything works very well.

    After I have remove the inventory VM1 and add to the inventory again.

    Then I login to vSphere Web Client with the User1 credentials and try to power on VM1, but get error not found "VM".

    I relog to vSphere Web Client with administrative rights and try to turn on VM1. VM1 on successfully.

    I check the permission for User1 on VM1. Everything was ok.

    Can I use vSphere Client Version 5.5.0 build 1746248 (not web) to USER1 qualifications and try to turn on VM1. VM1 lit with success!

    But I need User1 to power on VM1 from WebClient.

    Do you have any suggestions?

    Thank you

    later I try to adjust the power on the authorization of USER1 (VM1), level of the virtual computer object. VM1 on WEB Client successfully!

    But I have put on leave at POOL1

    Yes, you are right.

    I solved the problrem. Thank you.

    After re - add to the discovered inventory updated VM1 on virtual machine file.

    I put read-only role in GROUP1 without spread on discovered virtual machine folder.

    VM1 powered with success on the web client and the vSphere Client.

  • I can't create the local group on vSphere Client 5.5

    Hello, Hello all!

    I'have the vSphere Client 5.5 and I cannot create a local group on the tab "local users and groups. When I create a group shows me an error and I can not create it. This is the error that I have:

    Call "HostLocalAccountManager.CreateGroup" of object "ha-localacctmgr" on ESXi 'IP' failed.

    I am connected to the root.

    I saw in other forums that it is impossible to create groups due to the last version is only possible in the Web Client that comes integrated with vCenter.

    In the old versions is possible, but when I open a session in vSphere Client 5.0 for example, I have to update version and I can't use the 5.0 version.

    How can you help me?

    Thanks and greetings

    PD: Sorry for my bad English

    Hi Danisb3,

    It seems that local users is now the recommended around work (see link above), but as you said if you have vCenter you can add groups

    ESXi 5.1 and later versions does not support local groups. However, Active Directory groups are supported - is it possible to connect to AD?

  • A tree inventory implemented in vSphere client web 5.1 does

    Hello

    I develop a vsphere client 5.1 web plugin.

    I need to implement the inventory tree in my plugin. The documentation guide and programming example speaks on the list of entities as the 'inventory' and not a hierarchical (tree inventory), as shown in the snapshot below.

    I've traveled "vSphere Web Client Extensions for vSphere 5.1 Programming Guide" and samples provided as "chassis-ui", but don't find anything (point/api extension) to view vsphere/custom entities in a hierarchical manner, as seen in vcenter section on the web client.

    Is it possible to display the objects tree in vSphere web client plugin?

    vmware_tree.png

    No, it is not possible to add your custom in the inventory tree in the left objects.  Our user interface will further hierarchical display of items because it is not scale upward (we left the inventory tree in this version to help people make the transition :-)

    Of course, you can create your own Flex Tree component to display what you want in your own opinion.

Maybe you are looking for

  • update of Firefox does not end, but has removed the old firefox

    If I end my firefox session and restart - I get a message from automatic update and it starts automatically - after a few minutes, I try to start firefox and target has been removed--firefox has gone--I downloaded the latest version of mozilla and it

  • inactive when connecting the mouse

    AT THE START OF MY LAPTOP WITH XP I GO AS FAR AS THE MICROSOFT XP WELCOME SCREEN WITH LOG IN BOX AND USER NAME WITH THE MOUSE POINTER IN THE CENTER OF THE SCREEN AND A COMMAND CLICK ON THE USERS NAME, THE CUSTOM OF MOUSE WERK -.HELP WOULD BE APPRECIA

  • BlackBerry smartphone App Error 523

    Can you please help me with this error on my curve 8520?

  • Detect the langauage of the user

    Now that the PlayBook supports some langugages, is there a way (in ActionScript) to detect which language a user is currently using?

  • My computer Windows 7 keeps closing

    My computer running Windows 7 keeps stop. This often happens when I'm running Google Chrome or Mozilla Firefox, but it happened when I'm running iTunes or browsing records. It also stops almost always when I am trying to run a performance check. Is n