0

I researched to process the reports using authentication on a vf page so that I can restrict the usage.

I found the following article to do the same using php in Five9:

https://stackoverflow.com/questions/13544495/five9s-api-how-to-pull-reports-using-soap-api-and-basic-authentication

Also, I got an article which discusses the same for a callout:

https://developer.salesforce.com/blogs/developer-relations/2009/01/using-basic-authentication-with-web-services.html

Here is the code which was proposed :

HTTP h = new HTTP();
HTTPRequest r = new HTTPRequest();
r.setEndpoint('https://my.domain.com');
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
r.setHeader('Authorization', authorizationHeader);
r.setMethod('GET');
HTTPResponse resp = h.send(r);

Please assist if this can be done in salesforce to access reports and dashboards.

Thanks!

3

No. Salesforce uses a number of authentication methods, including SAML, SOAP, and OAuth2. However, Basic Authentication is not supported by Salesforce. You'll have to use another means of authentication. You'll want to read the various developer guides to determine which method is best for your use case, but you'll probably want OAuth2, which is relatively simple to use and avoids you needing to handle/maintain usernames and passwords.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.