SSO From asp.net site

We have a site builded in asp.net and one of our partners has a WP site where he uses s2Member.

When loggin to our site we would like our customers also to login to the WP site.

I can see that s2Member has Pro API for Remote Operations but i cant figure out how to post from asp.net with the right parameters.

You won’t be able to use the s2Member Pro API from ASP.net because ASP.net and WordPress use different programming languages. Instead, what you’ll need to do is use WordPress’s own REST API, which will enable you to get the sites talking to each other via JavaScript.

I know :slight_smile:

I Would just like to know if anyone have build the code stated on https://s2member.com/kb-article/pro-api-for-remote-operations/ for asp.net for ‘auth_check_user’

I don’t understand your response. My point is that you can’t do that. You need to use JavaScript and that’s written in PHP.

Sorry, didnt mean anything. Thouhgt it could be done by posting from an .net client.

I’m a bit blank in PHP, and having trouble getting the JavaScript equivalent to the PHP Example.

When using the code below i get : Error: $_POST[‘s2member_pro_remote_op’] is NOT a serialized array.

    var postData;
    function authenticateUser(apiKey, userName, passWord) {
        var output = {};
        output["op"] = "auth_check_user";
        output["api_key"] = apiKey;
        var authArray = {"user_login": userName, "user_pass":passWord};
        output["data"] = authArray;
        postData = JSON.stringify(output);
        $.ajax({
            url: "http://www.mydomain.com/?s2member_pro_remote_op=1",                
            type: "POST",
            contentType: "application/x-www-form-urlencoded", // send as JSON
            data: { "s2member_pro_remote_op": postData }, //ur data to be sent to server
            success: function (data) {
                result = $.parseJSON(data.d);
                
                return result;
            },
            error: function (x, y, z) {
                return undefined;
            }
        });
    }

I would use WP’s own REST API instead.