Source/NFX.Web/Social/SocialNetwork.cs
/// <summary>
/// Fills user info with values from social network
/// </summary>
/// <param name="userInfo">Context user info</param>
/// <param name="request">Context http request</param>
/// <param name="returnURL">Social network login URL (sometimes needed by social site just to ensure correct call)</param>
Fills user info with values from social network
Fills user info with values from social network
public void ObtainTokensAndFillInfo(SocialUserInfo userInfo, JSONDataMap request, string returnURL)
        {
          try
          {
            if (userInfo.LoginState != SocialLoginState.NotLoggedIn)
              throw new NFXException(SocialStringConsts.INVALID_STATE_ERROR.Args(SocialLoginState.NotLoggedIn, userInfo.LoginState)
                + GetType().Name + ".ObtainTokensAndFillInfo");
            DoObtainTokens(userInfo, request, returnURL);
            userInfo.LastError = null;
            userInfo.LoginState = SocialLoginState.TokenObtained;
            DoRetrieveLongTermTokens(userInfo);
            userInfo.LoginState = SocialLoginState.LongTermTokenObtained;
            DoRetrieveUserInfo(userInfo);
            userInfo.LoginState = SocialLoginState.LoggedIn;
            if (m_InstrumentationEnabled) Interlocked.Increment(ref m_stat_Login);
          }
          catch (Exception ex)
          {
            userInfo.LastError = ex;
            if (m_InstrumentationEnabled) Interlocked.Increment(ref m_stat_LoginErr);
          }
        }
public void ObtainTokensAndFillInfo ( SocialUserInfo userInfo , JSONDataMap request , string returnURL ) { try { if ( userInfo . LoginState != SocialLoginState . NotLoggedIn ) throw new NFXException ( SocialStringConsts . INVALID_STATE_ERROR . Args ( SocialLoginState . NotLoggedIn , userInfo . LoginState ) + GetType ( ) . Name + " " ) ; DoObtainTokens ( userInfo , request , returnURL ) ; userInfo . LastError = null ; userInfo . LoginState = SocialLoginState . TokenObtained ; DoRetrieveLongTermTokens ( userInfo ) ; userInfo . LoginState = SocialLoginState . LongTermTokenObtained ; DoRetrieveUserInfo ( userInfo ) ; userInfo . LoginState = SocialLoginState . LoggedIn ; if ( m_InstrumentationEnabled ) Interlocked . Increment ( ref m_stat_Login ) ; } catch ( Exception ex ) { userInfo . LastError = ex ; if ( m_InstrumentationEnabled ) Interlocked . Increment ( ref m_stat_LoginErr ) ; } }
Fills user info with values from social network
Fills user info with values from social network
userInfo
SocialUserInfo
Context user info
Context user info
request
JSONDataMap
Context http request
Context http request
returnURL
string
Social network login URL (sometimes needed by social site just to ensure correct call)
Social network login URL ( sometimes needed by social site just to ensure correct call )