joomla 3 with mod adfs plugin, debugging in visual studio 2013


Took three days to build a debugging php/joomla site in visual studio, having created the site in azure websites, synced to webmatrix, and then launched visual studio (with php plugin).

Various fiddles to make the synced website, running in IIS Express typically, fire up in the debuggers own web server, on the same port as IIS express, with the debug monitor enabled.

image

Since we are targeting version 3.3 now of joomla (since that is what comes with azure), we have to make some changes to our older code. First off, to make the login button appear (somewhere), we had to change how the module helper  class is loaded:

image

More generally, we configured the modules and plugins, as shown next:

image

authentication

 

image

user

 

image

system

 

image

image

module

Second, the getToken method in the JUtility class has gone! as we learn from

image

http://stackoverflow.com/questions/18416247/joomla-3-0-call-to-undefined-method-jutilitygettoken

We fix this, in version specific manner, as shown:

image

(note how we were unable to even include the older versions class reference… except in a comment hint…as linking errors otherwise prevent loading)

to run all this, we emulate a live joomla site, with know good test parameters. Fiddler is configured to redirect the live site’s URIs to the localhost process under debugger control thus:

image

This assumes that our localhost joomla, with our sso plugin, has been configured with a copy of the IDP metadata (see http://1drv.ms/1DQxhUF) for DEMO/9 IDP and expects to title itself as the SP whose audience is mgs.rapams.com.

image

image

https://ssoportallax.rapmls.com/spinitiatedssohandler.aspx/DEMO/9

 

On windows server, we have to add each domain to the trusted site lists:

image

Now that we have a basic setup, we refine the testing parameters to use the so called federation mode flow (with DEMO/9 being the FP, and demo/8 being the IDP)

image

This allows us to get to: a complete flow, for the first time:

image

To get to auto-registration of a user, there are a couple more porting bugs to fix

image

We need to adopt the latest status return value conventions, for positive

$version = new JVersion();
if ($version->RELEASE == ‘3.3’) {
    $response->status = 1;
} else {
    $response->status = JAUTHENTICATE_STATUS_SUCCESS;
}

and negative return paths

               $version = new JVersion();
                if ($version->RELEASE == ‘3.3’) {
                   //
                } else {
                    $response->status = JAUTHENTICATE_STATUS_FAILURE;
                }

 

Since the assertion apparently indicates a null-string email attribute, this upsets some of the joomla 3 login (in a way that presumably it did not upset 2.5 logic). So we amend the condition:

//////////// EMAIL   
                    if (isset($userDetails->attributes[“email”])) {
                        if ($userDetails->attributes[“email”][0] == “”)
                        {
                            ;
                        }
                        else 
                        {
                            $response->email = $userDetails->attributes[“email”][0];
                        }
                    }

once we manually gave the rapstaff user a registered/super user group assignment, the login screen showed what one would expect

image

To make the debugging process easier (upon receipt of assertion), we amended the inbound message handle thus:

image

Advertisements

About home_pw@msn.com

Computer Programmer who often does network administration with focus on security servers. Very strong in Microsoft Azure cloud!
This entry was posted in fiddler. Bookmark the permalink.