Authenticate from an App using social login

Introduction

The S-360 public APIs allow authentication from an App using a social login.

We suppose already known the identity provider user reference. (in the case of facebook, it is the Facebook unique Id)

Sequence

The sequence of calls to accomplish are :

  1. authenticate using provider user reference.
  2. If OK, generate remember me cookie. That cookie can be used from an App to allow the user to be logged in the shop's webview.
  3. If not OK, createUser on ContactSocialLoginService
  4. then authenticate using provider user reference.
  5. If OK, goto 2

Example of calls are provided below.

Nota bene : at this state, contact's firstname, lastname, etc. are not set. To fully update contact data, use contactNumber provided by call to authenticate and call saveIndividualContactData.

Call to ContactSocialLoginService.createUser

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_0.ContactSocialLoginService.sociallogin.service.secutix.com/" 
  xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
  <soapenv:Header>
    <ns2:Security soapenv:mustUnderstand="1">
      <ns2:UsernameToken>
        <ns2:Username>CUBE_B2C</ns2:Username>
        <ns2:Password>password</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v1:createUser>
      <signUpData>
        <email></email>
        <firstname>41</firstname>
        <gender>MRS</gender>
        <lang>FR</lang>
        <lastname>797997979</lastname>
        <phoneNumber>797997979</phoneNumber>
        <phonePrefix>41</phonePrefix>
        <title>MRS</title>
      </signUpData>
      <provider>ACCOUNT_KIT</provider>
      <providerUserReference>1520956517919901</providerUserReference>
    </v1:createUser>
  </soapenv:Body>
</soapenv:Envelope>

Call to ContactPublicAuthenticationService.authenticate

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://v2_21.ContactAuthenticationPublicService.service.secutix.com/" 
  xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
  <soapenv:Header>
    <ns2:Security soapenv:mustUnderstand="1">
      <ns2:UsernameToken>
        <ns2:Username>CUBE_B2C</ns2:Username>
        <ns2:Password>password</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v2:authenticate>
      <contactAuthenticationData>
        <contactTypeScope>INDIVIDUAL</contactTypeScope>
        <identityProvider>ACCOUNT_KIT</identityProvider>
        <providerUserReference>1520956517919901</providerUserReference>
        <rememberMe>true</rememberMe>
        <socialLogin>true</socialLogin>
      </contactAuthenticationData>
    </v2:authenticate>
  </soapenv:Body>
</soapenv:Envelope>

Response of ContactPublicAuthenticationService.authenticate

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns2:authenticateResponse xmlns:ns2="http://v2_21.ContactAuthenticationPublicService.service.secutix.com/">
      <ContactAuthenticationResult>
        <requestId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
        <statusCode>success</statusCode>
        <statusDetail xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
        <contactNumber>10000000957</contactNumber>
        <identification>77+9Wu+/ve+/vTvvv73vv70p77+977+977+977+977+977+977+9Ve+/vWAZ</identification>
        <uniqueToken>77+9dXLvv70k77+977+9Fu+/vT8jDGjvv70JC++/vSLvv70=</uniqueToken>
      </ContactAuthenticationResult>
    </ns2:authenticateResponse>
  </S:Body>
</S:Envelope>