Custom service for portal user giving 403 error

Hi everyone,

 

I created a custom entity named "Services" and made it available on the Customer Portal. On the external portal page, I added a “Get Signature” button. When portal users click this button, modal opens pop up with a signature pad and Save / Cancel buttons.

When the user clicks Save, I want to store the entered signature into a field on the Services record.

To achieve this, I wrote the following custom configuration service using add source code option. This service was Saved and published correctly in Creatio system.
Issue:

When I test this service using Postman while logged in as the Supervisor using below URL, everything works correctly — the field is updated.
{{BaseURI}}/0/rest/SaveSignatureService/SaveSignature

However, when I call the same service as a portal user, I get this IIS error:

HTTP Error 403.0 – Access to non-SSP API is denied for portal users

Even if I try updating a field on the Case object instead of my custom entity, I get the exact same 403 error. Also, all operation permissions on the Services object are granted to the external user roles.

What I Need Help With

  • Why exactly are portal users receiving “Access to non-SSP API is denied”?

Any guidance or best practices on building Creatio services accessible to external/SSP users would be greatly appreciated.

Like 0

Like

2 comments
Best reply

You need to add these attributes to your service class: 

[DefaultServiceRoute]
[SspServiceRoute]

Note, those are added to the SaveSignatureService class, not the service method SaveSignature. 

With those added, the path to call the service is slightly different for external/portal users. Full Creatio (internal) users will use: 

0/rest/UsrMyService/SomeMethod

External users will use: 

0/ssp/rest/UsrMyService/SomeMethod

You can use the following code, if needed, to get the correct path/url based on the user type, it will return the correct path for both user types: 

var workspaceBaseUrl = Terrasoft.utils.uri.getConfigurationWebServiceBaseUrl();
 
var servicePath = workspaceBaseUrl + "/rest/UsrMyService/SomeMethod";
 
//servicePath will now contain the correct URL for either user type

Ryan

You need to add these attributes to your service class: 

[DefaultServiceRoute]
[SspServiceRoute]

Note, those are added to the SaveSignatureService class, not the service method SaveSignature. 

With those added, the path to call the service is slightly different for external/portal users. Full Creatio (internal) users will use: 

0/rest/UsrMyService/SomeMethod

External users will use: 

0/ssp/rest/UsrMyService/SomeMethod

You can use the following code, if needed, to get the correct path/url based on the user type, it will return the correct path for both user types: 

var workspaceBaseUrl = Terrasoft.utils.uri.getConfigurationWebServiceBaseUrl();
 
var servicePath = workspaceBaseUrl + "/rest/UsrMyService/SomeMethod";
 
//servicePath will now contain the correct URL for either user type

Ryan

Ryan Farley,

Thank you for your prompt and detailed response. The solution you provided worked perfectly, and I sincerely appreciate the time and expertise you invested in addressing my issue. Your support has been extremely helpful.

Thank you once again for your assistance.

Show all comments