You need to sign in to do that
Don't have an account?
![Nitin Palmure 5 Nitin Palmure 5](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Getting issue due to SSO
Hello,
I am trying to integrate Jira to Salesforce using service rocket plugin.
I am trying to run following code in Execute Anonymous
Now the problem is that System.debug(res1.getHeader('Location')); is giving me our SSO login URL and system.debug(res1.getStatusCode());
How do I handle this situation so that I can get system.debug(res1.getStatusCode()); as 200 ?
Please help.
Regards
Nitin V Palmure
I am trying to integrate Jira to Salesforce using service rocket plugin.
I am trying to run following code in Execute Anonymous
final static String JIRA_ENDPOINT = JIRA_Config__c.getInstance().JIRA_Endpoint__c; HttpRequest req1 = new HttpRequest(); req1.setEndpoint(JIRA_ENDPOINT); req1.setHeader('Content-Type', 'application/json'); req1.setMethod('GET'); Http http1 = new Http(); HttpResponse res1 = http1.send(req1); system.debug(req1); system.debug(res1); system.debug(req1); String username='nitin.palmure@pubmatic.com'; String password='Password@123'; String location; String endpoint; try{ while (res1.getStatusCode() == 302) { location = res1.getHeader('Location'); endpoint = location +'&os_username=' +username +'os_password' +password+; //req1.setEndpoint(res1.getHeader('Location')); //req1.setMethod('GET'); //req1.setHeader('Content-Type', 'application/json'); res1 = new http().send(req1); } }catch(Exception ex) { System.debug(ex); } system.debug(res1.getStatusCode()); System.debug(res1.getHeader('Location')); System.debug(res1.getHeader('Set-Cookie'));
Now the problem is that System.debug(res1.getHeader('Location')); is giving me our SSO login URL and system.debug(res1.getStatusCode());
How do I handle this situation so that I can get system.debug(res1.getStatusCode()); as 200 ?
Please help.
Regards
Nitin V Palmure
![Nitin Palmure 5 Nitin Palmure 5](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Just wanted to clarify that system.debug(res1.getStatusCode()); gives me 301.