VMware Cloud Community
filosmith
Enthusiast
Enthusiast

vRSLCM API Authentication

I can't authenticate to the vRSLCM API following the instructions at this page:

https://code.vmware.com/docs/12743/vrealize-suite-lifecycle-manager-8-2-api-programming-guide

 

"Authentication

The request examples assume that you are using basic access authentication with a token for a local user, such as user@local. The example token is the Base64 encoded value of "username:password", where the username is admin@local and password is the password for admin@local."

 

I base64 my username and password, separated by a :, add it as an Authorization header, and get 401.

 

Anyone have this working?

Tags (2)
0 Kudos
4 Replies
jimmyvandermast
Hot Shot
Hot Shot

Here is my example from Powershell that works fine when I use something like admin@local as username:

 

$auth               = $username + ':' + $password
$Encoded            = [System.Text.Encoding]::UTF8.GetBytes($auth)
$EncodedPassword    = [System.Convert]::ToBase64String($Encoded)

$headers = @{
 "Accept"="application/json"
 "Authorization"="Basic $($EncodedPassword)"
 "Content-Type"="application/json"
}

$body = ""
$jsonbody = $body | ConvertTo-Json

$method = "POST"
$api = "/lcm/authzn/api/login"

$res = $null
$res = Invoke-WebRequest -Uri ($server+$api) -Method $method -Body $jsonbody -Headers $headers -UseBasicParsing -SessionVariable session
$res.StatusCode
If ($res.StatusCode -ne 200) {"ERROR!"; BREAK}

 

0 Kudos
filosmith
Enthusiast
Enthusiast

Thanks. I verified with support that it only works with local accounts.

0 Kudos
jimmyvandermast
Hot Shot
Hot Shot

Agree. Your question was also about admin@local so that should be just fine.  🙂

0 Kudos
MeyMath
Contributor
Contributor

HI,
did you have a script for authentication via vIDM integration
Every time i get a 401 not authorized message.

I get a oauth token with a service vIDM api user and shared key.

But I'm not able to authenticate with with access token

Any ideas?
KR
Mathias

0 Kudos