StesCodes

Documentation of Social Login - API(.net) version 1.0

The StesCodes Social Login provides the ability to login the user in clicks. The below is the technical document to configure the social login.
 

Getting Signature Key

The first step in using our Social Login API is getting the signature key, signature key(transaction id) is found once you make purchase and redirected to our website and also found on the email which you receive from StesCodes after you make purchase. The transaction id of StesCodes is refered to as signature key.

Inorder to use the trial, you need to generate the key here http://stescodes.com/trial.aspx. You shall get the key based on the selection of plan.

back to top

Social Login

The next step after getting the signature key is to creating reference.

Reference

  • Add reference to stescodes_eval.dll on your project bin folder
  • Import the namespace "stescodes_eval"
Note: You shall download the stescodes_eval.dll for .net 2008 here Download
You shall download the stescodes_eval.dll for .net 2010 here Download
back to top

Social Login

Add the below appsettings on your web.config file


    <add key="licensekey" value="StesCodes signature key here"/>
    
    
    <add key="FBApiKey_" value="your facebook api key"/>
    <add key="FBSecretKey_" value="your facebook api secret key"/>
    
    <add key="consumerKey_twitter" value="your twitter api key"/>
    <add key="consumerSecret_twitter" value="your twitter api secret key"/>

    <add key="LiApiKey" value="your linkedin api key" />
    <add key="LiSecretKey" value="your linkedin api secret key" />

    <add key="GPlusApiKey" value="your googleplus api key"/>
    <add key="GPlusSecretKey" value="your googleplus api secret key"/>

    <add key="GoogleApiKey" value="your google api key"/>
    <add key="GoogleSecretKey" value="your google api secret key"/>

    <add key="OrkutApiKey" value="your orkut api key"/>
    <add key="OrkutSecretKey" value="your orkut api secret key"/>

    <add key="consumerKey_yahoo" value="your yahoo api key"/>
    <add key ="consumerSecret_yahoo" value="your yahoo api secret key"/>

    <add key="consumerKey_myspace" value="your myspace api key"/>
    <add key ="consumerSecret_myspace" value="your myspace api secret key"/>

    <add key="wll_appid" value="your live api key"/>
    <add key="wll_secret" value="your live api secret key"/>

    <add key="consumerKey_foursquare" value="your foursquare api key"/>
    <add key ="consumerSecret_foursquare" value="your foursquare api secret key"/>

    <add key="AOL_developerkey" value="your aol api key"/>

    <add key="soundcloudApiKey" value="your soundcloud api key"/>
    <add key="soundcloudSecretKey" value="your soundcloud api secret key"/>

    <add key="MeetupApiKey" value="your meetup api key"/>
    <add key="MeetupSecretKey" value="your meetup api secret key"/>

    <add key="GithubApiKey" value="your github api key"/>
    <add key="GithubSecretKey" value="your github api secret key"/>

    <add key="lastfmApiKey" value="your lastfm api key"/>
    <add key="lastfmSecretKey" value="your lastfm api secret key"/>

    <add key="upcommingApiKey" value="your upcoming api key"/>

    <add key="consumerKey_flickr" value="your flickr api key"/>
    <add key ="consumerSecret_flickr" value="your flickr api secret key"/>
    
            
back to top

Login/Register

To start grabbing user information, you have to make request to three functions

  1. getAuthenticationUrl
  2. getAccessToken
  3. getUserInformation

To configure API keys, click here How to configure API keys.

Request for getAuthenticationUrl

Make a request to https://stescodes.com/socialloginapi.aspx using "GET" method (Please url encode the parameter values).


            https://stescodes.com/socialloginapi.aspx?
                                 ServiceName=<servicename>&
                                 ConsumerKey=<your consumer key>&
                                 ConsumerSecret=<your consumer secret key>&
                                 CallbackUrl=<return url>&
                                 PolicyUrl=<policy page url>&
                                 format=<return format>
                   

Parameters

Parameters Description Required?
1. ServiceName Service Name refers to the social networks. Inorder to access a service use the below reference keywords
facebook, gplus, twitter, linkedin, google, yahoo, aol, live, myspace, flickr, foursquare, soundcloud, openid, meetup, github, lastfm, upcoming and orkut.
Yes
2. ConsumerKey Consumer key(API Key) which you received after registering you application on facebook, gplus, twitter, linkedin, google, yahoo, aol, live, myspace, flickr, foursquare, soundcloud, openid, meetup, github, lastfm, upcoming and orkut. Yes
3.ConsumerSecret Consumer Secret(APi Secret) which you received after registering you application on facebook, gplus, twitter, linkedin, google, yahoo, aol, live, myspace, flickr, foursquare, soundcloud, openid, meetup, github, lastfm, upcoming and orkut. Yes
4. CallbackUrl CallbackURL is the return url which is used, once the user is redirected to authorize, he/she will be redirected to the callbackurl (note: sometimes you might get error with callbackurl between www.xx.com and xx.com, so carefull with www) Yes
5. PolicyUrl URL of your policy page. Yes
6. Format
  • JSON - (by default)
  • XML
Yes

Response

The return type is a of format JSON and XML, below are the example response of JSON and XML formats.

JSON response:

                    
                        {   "Token": "your token", 
                            "TokenSecret" : "your token secret",
                            "TokenVerifier" : "your token verifier",
                            "authurl" : "your authentication url", 
                            "uid" : "User id", 
                            "error" : "error if present" 
                         } 
                    

XML response:

                    
            <?xml version="1.0"?>
            <ArrayOfUserToken xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                                                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                <UserToken>
                    <Token>your token</Token>
                    <TokenSecret>your token secret</TokenSecret>
                    <TokenVerifier>your token secret</TokenVerifier>
                    <authurl>your authentication url</authurl>
                    <UID>user id</UID>
                    <error>user id</error>
                </UserToken>
            </ArrayOfUserToken>
                    
                    
back to top

Request for GetAccessToken

Make a request to https://stescodes.com/socialloginapi.aspx using "GET" method (Please url encode the parameter values).


            https://stescodes.com/socialloginapi.aspx?
                                 ServiceName=<servicename>&
                                 ConsumerKey=<your consumer key>&
                                 ConsumerSecret=<your consumer secret key>&
                                 CallbackUrl=<return url>&
                                 Token=<your token>&
                                 TokenSecret=<your token secret>&
                                 TokenVerifier=<your token verifier>&
                                 format=<return format>&
                                 Signature=<formatted stescodes signature key>
                   

Parameters

Parameters Description Required?
1. ServiceName Service Name refers to the social networks. Inorder to access a service use the below reference keywords
facebook, gplus, twitter, linkedin, google, yahoo, aol, live, myspace, flickr, foursquare, soundcloud, openid, meetup, github, lastfm, upcoming and orkut.
Yes
2. ConsumerKey Consumer key(API Key) which you received after registering you application on facebook, gplus, twitter, linkedin, google, yahoo, aol, live, myspace, flickr, foursquare, soundcloud, openid, meetup, github, lastfm, upcoming and orkut. Yes
3.ConsumerSecret Consumer Secret(APi Secret) which you received after registering you application on facebook, gplus, twitter, linkedin, google, yahoo, aol, live, myspace, flickr, foursquare, soundcloud, openid, meetup, github, lastfm, upcoming and orkut. Yes
4. CallbackUrl CallbackURL is the return url which is used, once the user is redirected to authorize, he/she will be redirected to the callbackurl (note: sometimes you might get error with callbackurl between www.xx.com and xx.com, so carefull with www) Yes
5. Token Token received after authentication. Yes
6. TokenSecret Your token secret Yes
7. TokenVerifier Token verifier received after authentication. Yes
8. Format
  • JSON - (by default)
  • XML
Yes
9. Signature Formated Signature:
In order to format the signature key, make reference of "processor" class and then pass your signature key along with the HttpContext object associated with the page as input parameter to "getSecretKey", which is a function of "processor" class. The signature must be formatted before making a request.
Yes

Response

The return type is a of format JSON and XML, below are the example response of JSON and XML formats.

JSON response:

                    
                        {   "Token": "your token", 
                            "TokenSecret" : "your token secret",
                            "TokenVerifier" : "your token verifier",
                            "authurl" : "your authentication url", 
                            "uid" : "User id", 
                            "error" : "error if present" 
                         } 
                    

XML response:

                    
            <?xml version="1.0"?>
            <ArrayOfUserToken xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                                                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                <UserToken>
                    <Token>your token</Token>
                    <TokenSecret>your token secret</TokenSecret>
                    <TokenVerifier>your token secret</TokenVerifier>
                    <authurl>your authentication url</authurl>
                    <UID>user id</UID>
                    <error>user id</error>
                </UserToken>
            </ArrayOfUserToken>
                    
                    
back to top

Request for getUserInformation

Make a request to https://stescodes.com/socialloginapi.aspx using "POST" method, to grab user info from various social networks(Please url encode the parameter values).


            https://stescodes.com/socialloginapi.aspx?
                                 ServiceName=<servicename>&
                                 ConsumerKey=<your consumer key>&
                                 ConsumerSecret=<your consumer secret key>&
                                 CallbackUrl=<return url>&
                                 Token=<your token>&
                                 TokenSecret=<your token secret>&
                                 TokenVerifier=<your token verifier>&
                                 Uid=<user id>&
                                 OID=<querystringvalue>&
                                 format=<return format>&
                                 Signature=<formatted stescodes signature key>
                   

Parameters

Parameters Description Required?
1. ServiceName Service Name refers to the mail servers. Inorder to access a service use the below reference keywords
gmail, yahoo, msn, hotmail and msnmessenger
Yes
2. Token Your access token. Yes
3. TokenSecret Your token secret Yes
4. TokenVerifier Your Token verifier. Yes
5. Uid Your user id Yes
6. Signature Formated Signature:
In order to format the signature key, make reference of "processor" class and then pass your signature key along with the HttpContext object associated with the page as input parameter to "getSecretKey", which is a function of "processor" class. The signature must be formatted before making a request.
Yes
7. ConsumerKey Consumer key(API Key) which you received after registering you application on gmail, yahoo, msn, hotmail and msnmessenger Yes
8.ConsumerSecret Consumer Secret(APi Secret) which you received after registering you application on gmail, yahoo, msn, hotmail and msnmessenger Yes
9. Format
  • JSON - (by default)
  • XML
Yes
10. OID Your full query string value after you get from user authentication. Yes/no

Response

The return type is a of format JSON and XML, below are the example response of JSON and XML formats.

JSON response:

                    [{
                                "aboutme":"",
                                "id":"",
                                "displayName":"",
                                "firstName":"",
                                "lastName":"",
                                "email":"",
                                "profileUrl":"",
                                "photo":"",
                                "location":"",
                                "phone":"",
                                "gender":"",
                                "relationship":"",
                                "dob":"",
                                "error":""
                         }]
                    

XML response:

                    
                    <?xml version="1.0"?>
                    <ArrayOfUserInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                                                xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                        <UserInfo>
                            <aboutme></aboutme>
                            <id></id>
                            <displayName></displayName>
                            <firstName></firstName>
                            <lastName></lastName>
                            <email></email>
                            <profileUrl></profileUrl>
                            <photo></photo>
                            <location></location>
                            <error></error>
                        </UserInfo>
                    </ArrayOfUserInfo>
                    
                    
back to top

Request for getOpenIDAuthURL

Make a request to https://stescodes.com/socialloginapi.aspx using "POST" method, to get OpenID Auth Url(Please url encode the parameter values).


            https://stescodes.com/socialloginapi.aspx?
                                 ServiceName=<servicename>&
                                 UserName=<openid user name>&
                                 CallbackUrl=<return url>&
                                 Domain=<your domain url>&
                                 format=<return format>&
                                 Signature=<formatted stescodes signature key>
                   

Parameters

Parameters Description Required?
1. ServiceName Service Name refers to the name of the openid providers.
Yes
2. UserName openid user name. Yes
3. CallbackUrl CallbackURL is the return url which is used, once the user is redirected to authorize, he/she will be redirected to the callbackurl (note: sometimes you might get error with callbackurl between www.xx.com and xx.com, so carefull with www) Yes
4. Domain Your domain url Yes
5. Signature Formated Signature:
In order to format the signature key, make reference of "processor" class and then pass your signature key along with the HttpContext object associated with the page as input parameter to "getSecretKey", which is a function of "processor" class. The signature must be formatted before making a request.
Yes
6. Format
  • JSON - (by default)
  • XML
Yes

Response

The return type is a of format JSON and XML, below are the example response of JSON and XML formats.

JSON response:

                    
                        {   "Token": "your token", 
                            "TokenSecret" : "your token secret",
                            "TokenVerifier" : "your token verifier",
                            "authurl" : "your authentication url", 
                            "uid" : "User id", 
                            "error" : "error if present" 
                         } 
                    

XML response:

                    
            <?xml version="1.0"?>
            <ArrayOfUserToken xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                                                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                <UserToken>
                    <Token>your token</Token>
                    <TokenSecret>your token secret</TokenSecret>
                    <TokenVerifier>your token secret</TokenVerifier>
                    <authurl>your authentication url</authurl>
                    <UID>user id</UID>
                    <error>user id</error>
                </UserToken>
            </ArrayOfUserToken>
                    
                    
back to top

Request for getOpenIdData

Make a request to https://stescodes.com/socialloginapi.aspx using "POST" method, to grab user info from openid providers(Please url encode the parameter values).


            https://stescodes.com/socialloginapi.aspx?
                                 UserName=<user name>&
                                 QueryValues=<allquerystring values>&
                                 format=<return format>&
                                 Signature=<formatted stescodes signature key>
                   

Parameters

Parameters Description Required?
1. UserName Openid user name Yes
2. QueryValues The response query string values from user authentication eg: token=XXXXXX&openid=YYYYYY&url=ZZZZZ Yes
3. Signature Formated Signature:
In order to format the signature key, make reference of "processor" class and then pass your signature key along with the HttpContext object associated with the page as input parameter to "getSecretKey", which is a function of "processor" class. The signature must be formatted before making a request.
Yes
4. Format
  • JSON - (by default)
  • XML
Yes

Response

The return type is a of format JSON and XML, below are the example response of JSON and XML formats.

JSON response:

                     { 
                                "nickname":" ",
                                "fname":"",
                                "lname":"",
                                "email":"",
                                "location":"",
                                "dob":"",
                                "relationship":"",
                                "gender":"",
                                "id":"",
                                "profilelink":"",
                                "photo":"",
                                "phone":"",
                                "aboutme":""
                           }
                    

XML response:

                    
                    <?xml version="1.0"?>
                    <OpenIDData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                                            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                          <nickname></nickname>
                          <fname></fname>
                          <lname></lname>
                          <email></email>
                          <location></location>
                          <dob></dob>
                          <relationship></relationship>
                          <gender></gender>
                          <id></id>
                          <profilelink></profilelink>
                          <photo></photo>
                          <phone></phone>
                          <aboutme></aboutme>
                    </OpenIDData>
                    
                    
back to top

Debugging

Debugging Windows Live:

Debugging for Hotmail, MSN and msnmessenger is hard when compared to other services because in OAuth method, for the three services, you receive the token in post data other than in querystring. So follow the below steps to debug in local
  1. Upload the auth.aspx page to your server.
  2. Do the below five steps when the user is redirected after authentication.
  3. Get the post data and construct as a url with querystring parameter(for ex: token=xxx&tokensecret=yyyy as http://youdomain.com/auth.aspx?token=xxx&tokensecret=yyyy)
  4. After constructing the parameter change the constructed url to localhost url(for ex: http://youdomain.com/auth.aspx?token=xxx&tokensecret=yyyy to http://localhost:2345/yourproject/auth.aspx?token=xxx&tokensecret=yyyy
  5. Redirect to the localhost url(for ex: Response.Redirect(http://localhost:2345/yourproject/auth.aspx?token=xxx&tokensecret=yyyy);)
  6. Now you will get the token in localhost for debugging.
  7. Remove the redirection part after you done with your debugging.
back to top

Binding

Once the informations are grabbed and received in collection object, you can bind the data to front end for registration process or check with the database for existance of the user and if exist login.
back to top

Error Handling

There are few error messages you need to taken care on your end

Error Message

Error Description
1. Invalid domain The license(Signature Key) is not registered for this domain. You shall change/edit your domain here http://stescodes.com/sourceupdate.aspx
2. Invalid key The Signature Key is invalid.
3. Missing input Missing the input parameter
4. This service not available on your plan The service you are requesting to grab contacts are not available on your purchased plan.
back to top

Change Domain

If you get the domain is invalid and you purchased license for that domain, then you shall follow the below steps to update your domain.

Edit/Change Domain

To edit or change your domain
  • Login to http://stescodes.com/sourceupdate.aspx
  • You shall login using email and password which you received in email during purchase or you shall use the StesCodes transaction id
  • Once you login, click the edit link near website
  • Enter the domain details
  • Click "proceed" to save.
back to top
HOME | TERMS OF SERVICE | PRODUCT | CONTACT US | PRIVACY POLICY | FAQ | SITE MAP
Copyright 2011 stescodes.com