Changeset 2c6b0f4 for protocols/msn


Ignore:
Timestamp:
2010-09-05T14:09:43Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
52f5e90
Parents:
975708a
Message:

Fix auth for @msn.com accounts.

Location:
protocols/msn
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/soap.c

    r975708a r2c6b0f4  
    262262        char *secret;
    263263        char *error;
     264        char *redirect;
    264265};
    265266
    266267static int msn_soap_passport_sso_build_request( struct msn_soap_req_data *soap_req )
    267268{
     269        struct msn_soap_passport_sso_data *sd = soap_req->data;
    268270        struct im_connection *ic = soap_req->ic;
    269271        struct msn_data *md = ic->proto_data;
    270272       
    271         if( g_str_has_suffix( ic->acc->user, "@msn.com" ) )
     273        if( sd->redirect )
     274        {
     275                soap_req->url = sd->redirect;
     276                sd->redirect = NULL;
     277        }
     278        else if( g_str_has_suffix( ic->acc->user, "@msn.com" ) )
    272279                soap_req->url = g_strdup( SOAP_PASSPORT_SSO_URL_MSN );
    273280        else
     
    312319        struct xt_node *code = xt_find_node( node->children, "faultcode" );
    313320        struct xt_node *string = xt_find_node( node->children, "faultstring" );
     321        struct xt_node *url;
    314322       
    315323        if( code == NULL || code->text_len == 0 )
    316324                sd->error = g_strdup( "Unknown error" );
     325        else if( strcmp( code->text, "psf:Redirect" ) == 0 &&
     326                 ( url = xt_find_node( node->children, "psf:redirectUrl" ) ) &&
     327                 url->text_len > 0 )
     328                sd->redirect = g_strdup( url->text );
    317329        else
    318330                sd->error = g_strdup_printf( "%s (%s)", code->text, string && string->text_len ?
     
    378390        };
    379391       
     392        if( sd->redirect )
     393                return MSN_SOAP_RETRY;
     394       
    380395        if( md->soapq )
    381396                return msn_soapq_flush( ic, TRUE );
     
    422437        g_free( sd->secret );
    423438        g_free( sd->error );
     439        g_free( sd->redirect );
    424440       
    425441        return MSN_SOAP_OK;
  • protocols/msn/soap.h

    r975708a r2c6b0f4  
    6262
    6363#define SOAP_PASSPORT_SSO_URL "https://login.live.com/RST.srf"
    64 #define SOAP_PASSPORT_SSO_URL_MSN "https://msnia.login.live.com/pp550/RST.srf"
     64#define SOAP_PASSPORT_SSO_URL_MSN "https://msnia.login.live.com/pp800/RST.srf"
    6565
    6666#define SOAP_PASSPORT_SSO_PAYLOAD \
Note: See TracChangeset for help on using the changeset viewer.