Installation

Download the sources from this site and compile the library using the TheFactorM.Federation.Android.sln file.

Note: There will be a package later on, but compiling the sources yourself is the way to go at the moment.

Configuration

In the app you need to add a reference to the TheFactorM.Federation.Android.dll assembly. After that you can initiate the signin process using the following code:

using TheFactorM.Federation.Android;

this.BeginSignInOperation("yourAcsNamespace", 
    "http://yourapp.cloudapp.net","Your-reply-address");


The first argument for the BeginSignInOperation is the ACS namespace you're using on your Azure deployment. The second argument is the URL for your Azure deployment (The home realm) and finally the third argument is the reply address used by the ACS in your Azure deployment.

You can invoke the signin operation from anywhere in your activity. The second bit of code to finalize the signin operation however, you need to add to the OnActivityResult method override in your activity.

protected override void OnActivityResult (int requestCode, Result resultCode, Intent data)
{
    base.OnActivityResult (requestCode, resultCode, data);

    // Finalize the signin operation. 
    // This gets you the ACS cookies, required to keep you signed in to the 
    // services you use in your app.
    var cookies =  this.FinalizeSignInOperation(requestCode,resultCode,data);

    if(cookies != null && cookies.Count > 0)
    {
        // Yay, received the ACS cookies. Store them somewhere safe
	// in your app and continue to use the app as normal.
    }
}

Further steps

After the cookies are retrieved you can use the cookies container on a SOAP client, WCF client or WebClient to communicate with your Azure deployed webservice or REST service.

Last edited May 21, 2013 at 6:26 AM by WMeints, version 2

Comments

No comments yet.