VMware Cloud Community
jmpm
Contributor
Contributor

REST call error found inside VRASNRequestUtil.getTemplateViaRest: Method failed: (/catalog-service/api/consumer/entitledCatalogItems/ecc38dd7-6484-462a-ab84-2e6ba14c2771/requests/template) with code: 401 - Invalid username/password combo

vra-snow issue.jpg

Good day.

Can someone help on the issue I'm facing with vRA-ServiceNow Integration?

I'm getting this error message when triggering a request from servicenow:

REST call error found inside VRASNRequestUtil.getTemplateViaRest: Method failed: (/catalog-service/api/consumer/entitledCatalogItems/ecc38dd7-6484-462a-ab84-2e6ba14c2771/requests/template) with code: 401 - Invalid username/password combo

Thanks

Joanne

20 Replies
kbhushan05
Enthusiast
Enthusiast

Have you configured the basic configuration page properly?

Also confirm if client registration is done or not?

Reply
0 Kudos
jmpm
Contributor
Contributor

yes.

Basic configuration has been properly configured properly as well as the client registration.

Reply
0 Kudos
rstoker13
VMware Employee
VMware Employee

I would recommend using curl or AdvancedRest Client or similar to attempt the request independently. This will allow you to validate that the username/password combo is accurate. Also, be sure that the service account you have configured inside of the ServiceNow plugin has the appropriate membership in the business group in question.

Example REST:

POST - https://{YOUR VRA FQDN}/identity/api/tokens

               HEADERS - content-type = application/json

               BODY - content type = application/json: {"username":"YourSNOWServiceAccount","password":"YOURSNOWServiceAccountPASSWORD","tenant":"vsphere.local(or your other tenant)"}

               Response - {This will be your bearer token}

GET - https://{YOUR VRA FQDN}//catalog-service/api/consumer/entitledCatalogItems/ecc38dd7-6484-462a-ab84-2e6ba14c2771/requests/template

               HEADERS - content-type = application/json ; authorization = Bearer {YourTokenTextHere}

               Response - If your account is good, this will be a JSON of the template you requested.

Let me know if you have questions. Good luck!

Ralph

Reply
0 Kudos
draymond10
Enthusiast
Enthusiast

How crazy is your password for the integration user?  I believe we saw this when our password had a special character like a quote " or something similar

Dave

Reply
0 Kudos
Sasidhar1234
Enthusiast
Enthusiast

I have a similar issue, I used the GET REST command as suggested, still facing HTTP 401 - Invalid username/password combo.

Please suggest if there is a checklist to verify the account is valid. This account is having Tenant/IaaS/Fabric admin privileges. I am able to provision a machine using the same account.

Reply
0 Kudos
EntergyChad
Contributor
Contributor

I'm having the same problem as well. Is the authentication done to get the catalog items different than the authentication to request one be created after approval? The code in VRASNRequestUtil seems to not use the the AuthToken that the other functions do, despite requesting it in the code.

VRASNLogger.debug('Inside  VRASNRequestUtil.getTemplateViaRest: Used to fetch the request template');

var auth = new VRASNPropertiesUtil();

//var authGen = auth.getSNProperties('AuthToken');

var authGen = auth.getSNProperties1();//certification changes

VRASNLogger.debug('getTemplateViaRest catalog is '+a);

VRASNLogger.debug('getTemplateViaRest userToken is '+userToken);

var vraID = "";

var catalogID = new GlideRecord('x_vmw_vmware_vrasp_vrasn_catalog_item');

catalogID.addQuery("sys_id",a);

catalogID.query();

if(catalogID.next()){

vraID = catalogID.vra_uid;

}

var _endPoint = this.endPoint + "/catalog-service/api/consumer/entitledCatalogItems/" + vraID + "/requests/template";

var apiUtil = new VRASNApiUtil();

var response = apiUtil.makeapicall(_endPoint, 'get', ' ', "application/json", "application/json", "Bearer "+userToken);

Reply
0 Kudos
draymond10
Enthusiast
Enthusiast

I'm also having the same issue; v4 Plugin

Postman can retrieve the template by POST against /api/tokens for Bearer Token and GET on /catalog-service/api/consumer/entitledCatalogItems/{CATALOG ITEM ID}/requests/template

I'm still seeing 401 Bad User/Password in ServiceNow

- updated user/pw in Basic properties

- updated the x_vmw_vmware_vrasp.vrasn.api.Auth.Token value of the token I got from POSTMAN

- ran vRealize Automation Login again with successful authentication to vRA with redirect back to ServiceNow

Is the catalog import job using the same authentication method as the GetTemplate call? Dave

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast

Hi EntergyChad​,

AuthToken is generated using account used in basic configuration whereas UserToken is the used to place request in the name of user with whom you did vRA redirection in initial step.

If you use Authtoken then request will land on vRA in the name of user account used in basic configuration.

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast

Hi David,

This is known issue and recently we have released patch for this error(401- username/Password combo error)

Please find below community links where you will find issue details, patch XML file and details how to upload it.


https://communities.vmware.com/docs/DOC-38877
https://vmware-com.socialcast.com/messages/39232800

Same is available on Marketplace as well at below link-

https://my.vmware.com/group/vmware/get-download?downloadGroup=VRA_ITSM_PLUGIN_400

EntergyChad
Contributor
Contributor

I can confirm this patch worked for me. Thanks!

Reply
0 Kudos
draymond10
Enthusiast
Enthusiast

I can confirm that this patch works for me.  The request is successfully submitted to vRA for provisioning.

However, I'm not getting any of the default resource mappings on the vmware instance that gets populated upon successful request.  Stuff like IP, CPU, Memory and Disk are all missing

pastedImage_0.png

Reply
0 Kudos
henswort
Enthusiast
Enthusiast

I also experienced the 401 errors when requesting vRA VM from SNOW, which the patch fixed.

I am now also not getting the VM characteristics (CPU, RAM, STG, etc.) back in SNOW

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast

Can you confirm if all these parameters(CPU, RAM, STG, etc.) were visible before applying this patch?

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast

Hi,

Can you confirm if all these parameters(IP, CPU, Memory and Disk) were visible in CMDB records before applying this patch?

Reply
0 Kudos
draymond10
Enthusiast
Enthusiast

They  were  not available prior to the patch

Reply
0 Kudos
henswort
Enthusiast
Enthusiast

Well the only VM information in SNOW was via discovery which did show the parameters (IP, CPU, RAM, STG, etc.) BEFORE and after the patch.

I couldn't deploy VM's via SNOW before applying the patch so I have no indication on whether these parameters would have been available before applying the patch.

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast

Thanks draymond10​.

We have taken a note of it and all these parameters will be made available in next patch for V4.0

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast

Hi henswort​ As draymond10​ confirmed, those were not available before patch as well,

We have taken a note of it and these parameters will be made available in next patch for V4.0

Reply
0 Kudos
draymond10
Enthusiast
Enthusiast

Crazy that this significant feature of the plugin capability was lost in v4 of the plugin....The ability to populate a Virtual Machine Instance with a CI Name as the only field coming from vRA gets us nowhere.  Let me know if you need the code to fix your issue on line 164 of the VRASNImportCMDB script include...thanks again to our internal SNOW developers. Also helpful would be to engage your partners who have been deploying this in the field Beta test your releases.

Reply
0 Kudos