function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jesus.cantero.chatt1.3952321544005415E12jesus.cantero.chatt1.3952321544005415E12 

Site.login call in Custom WebService Rest

Is it possible to call Site.Login function inside a public Rest WebService? This web service is defined using annotations @RestResource and @HttpPost
Gaurav NirwalGaurav Nirwal
Here's some sample code for the target org - it's very simple indeed:

view sourceprint?
@RestResource(urlMapping='/TestRest')
global class TestRest {
    @HttpGet
    global static String getTestRest(RestRequest req, RestResponse res) {
        String name = req.params.get('name');
        return 'Hello '+name;
    }
}