Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
phoenixkiller Frequent Contributor.
Frequent Contributor.
280 views

ALM 12.50 SaaS trial version : Rest authentication

Hello,

I'm trying to authenticate the trial cloud version of alm for rest API. But I am getting 403 forbidden error for the URL : https://almalm1250saastrial.saas.hpe.com/qcbin/api/authentication/sign-in

1.PNG

Also if I try using the below URL : https://almalm1250saastrial.saas.hpe.com/qcbin/authentication-point/authenticate

2.PNG

I am using the same user ID and password used for microfocus login page. Please tell me if this is right, I am banging my head over it for 2 days now.

Is there any other username and password associated with the alm trial other than the below3.PNG

0 Likes
8 Replies
Honored Contributor.. arichtman Honored Contributor..
Honored Contributor..

Re: ALM 12.50 SaaS trial version : Rest authentication

We have 12.55.2 and you have to:

  1. POST w/ basic authorization header to /api/authentication/sign-in
  2. Read 3 x response cookies
  3. Start using API at /rest/domains/####/projects/####/
    Must pass all 3 cookies with each request or you won't be authenticated.
$alm_uri = "http://alm/qcbin"
$uri = "$alm_uri/api/authentication/sign-in"

#region auth headers
$User_Pass  = $logon + “:” + $password
$bytes= [System.Text.Encoding]::UTF8.GetBytes($User_Pass)
$encoded_login=[Convert]::ToBase64String($bytes)
$Auth_Header = "Basic " + $encoded_login
$headers = @{}
$headers.Add("Authorization",$Auth_Header)
#endregion

$headers.Add('Accept','application/json')
$headers.Add('Content-Type','application/json; charset=utf-8')

Invoke-RestMethod -Method Post -Uri $uri -Headers $headers -SessionVariable web_session

$uri = "$alm_uri/rest/domains/public/projects/training/defects?fields=id,name"

$Response = Invoke-RestMethod -Method Get -Uri $uri -WebSession $web_session
 
 
phoenixkiller Frequent Contributor.
Frequent Contributor.

Re: ALM 12.50 SaaS trial version : Rest authentication

Hi,

I invoked the the authentication as required.

1.PNG

But I am getting the 403 error. Forbidden.

Can you please help me with the above. Any Help is appreciated.

Thanks for help

0 Likes
phoenixkiller Frequent Contributor.
Frequent Contributor.

Re: ALM 12.50 SaaS trial version : Rest authentication

Bump! Anything from your side? Stuck here with authentication issue!
0 Likes
Honored Contributor.. arichtman Honored Contributor..
Honored Contributor..

Re: ALM 12.50 SaaS trial version : Rest authentication

I checked my session variable and the following are the cookies

All else I can say is: raise a support ticket

JSESSIONID      
LWSSO_COOKIE_KEY
QCSession       
ALM_USER        
XSRF-TOKEN      
 
 
phoenixkiller Frequent Contributor.
Frequent Contributor.

Re: ALM 12.50 SaaS trial version : Rest authentication

Is there any specific access required for this authentication to work? For using REST API?
0 Likes
phoenixkiller Frequent Contributor.
Frequent Contributor.

Re: ALM 12.50 SaaS trial version : Rest authentication

Hi,

I tried using PowerShell, this is the result.

PS C:\Users\687425> $alm_uri = "https://almalm1250saastrial.saas.hpe.com/qcbin"
PS C:\Users\687425> $uri = "$alm_uri/api/authentication/sign-in"
PS C:\Users\687425> $User_Pass = "shravanbhavsar007_gmail.com"+ “:” + "pass@2019"
PS C:\Users\687425> $bytes= [System.Text.Encoding]::UTF8.GetBytes($User_Pass)
PS C:\Users\687425> $encoded_login=[Convert]::ToBase64String($bytes)
PS C:\Users\687425> $Auth_Header = "Basic " + $encoded_login
PS C:\Users\687425> $headers = @{}
>> $headers.Add("Authorization",$Auth_Header)
PS C:\Users\687425> $headers.Add('Accept','application/json')
>> $headers.Add('Content-Type','application/json; charset=utf-8')
PS C:\Users\687425> Invoke-RestMethod -Method Post -Uri $uri -Headers $headers -SessionVariable web_session
Invoke-RestMethod :
Error 403 Forbidden
HTTP ERROR 403
Problem accessing /qcbin/api/authentication/sign-in. Reason:
ForbiddenPowered by Jetty://
At line:1 char:1
+ Invoke-RestMethod -Method Post -Uri $uri -Headers $headers -SessionVa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

 

 

Can you Please help me on this?

0 Likes
Honored Contributor.. arichtman Honored Contributor..
Honored Contributor..

Re: ALM 12.50 SaaS trial version : Rest authentication

Ver 12.60 can lock out API access but 12.5x doesn't have that site configuration parameter [at least not officially]

Raise a SaaS support ticket. We don't have the access or visibility to completely troubleshoot this.

 

 
 
0 Likes
Brause Frequent Contributor.
Frequent Contributor.

Re: ALM 12.50 SaaS trial version : Rest authentication

I also had issues with the REST login on the trail server, but resolved them by sending my cred directly to "https://login.software.microfocus.com/msg/actions/doLogin.action" as "application/x-www-form-urlencoded", the request will pass and you get your cookies. Just remember to use the actual login email you also use on the login page. Also you have to use these cookies to get the session cookie with an additional call but thats like described in the offcial documentation.

request_1.pngrequest_2.png

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.