public void OAuthSuccess(string data) { string[] args = data.Split(';'); // Expires_in is no longer mandatory. if (args.Length < 2) { Debug.LogError("Auth failed. Bad argument count - " + args.Length); Debug.LogError("Should at least 2: access_token, session_secret_key, expires_in(optional)"); if (authCallback != null) { authCallback(false); authCallback = null; } return; } AccessToken = args[0]; //temp fix for permissions_granted change SessionSecretKey = args[1].Split('&')[0]; authRequested = OKAuthType.None; AuthType = OKAuthType.OAuth; Debug.Log("Authorized via OAuth!"); // Send any unsent payment reports. ReportPaymentSendInternal(); if (authCallback != null) { authCallback(true); authCallback = null; } HideWebView(); }
public void SSOAuthFailed(string details) { authRequested = OKAuthType.None; Debug.Log("Received SSO Auth failed callback: " + details); bool cancelled; if (bool.TryParse(details.Replace("cancelled:", ""), out cancelled) && cancelled) { Debug.Log("Manual cancelled via Back"); if (authCallback != null) { authCallback(false); authCallback = null; } } else { if (fallbackToOAuth) { Debug.Log("Fallback to OAuth"); OAuth(); } else { if (authCallback != null) { authCallback(false); authCallback = null; } } } }
public void OAuthSuccess(string data) { string[] args = data.Split(';'); if (args.Length != 3) { Debug.LogError("Auth failed. Bad argument count - " + args.Length); Debug.LogError("Should be 3: access_token, session_secret_key, expires_in"); if (authCallback != null) { authCallback(false); authCallback = null; } return; } AccessToken = args[0]; //temp fix for permissions_granted change SessionSecretKey = args[1].Split('&')[0]; AccessTokenExpiresAt = ParseExpiration(args[2]); AuthType = OKAuthType.OAuth; Debug.Log("Authorized via OAuth!"); if (authCallback != null) { authCallback(true); authCallback = null; } HideWebView(); }
public void OAuthFailed(string details) { Debug.LogError("Received OAuth failed callback: " + details); if (authCallback != null) { authCallback(false); authCallback = null; } HideWebView(); }
public void RefreshOAuth(OKAuthCallback action) { authCallback = action; if (Application.isEditor) { Debug.Log("Authorization unavailable in Unity Editor"); if (authCallback != null) { authCallback(false); authCallback = null; } return; } if (clearTokenOnAuth) { ClearTokens(false); } OpenWebView(GetAuthUrl()); }
public virtual void Auth(OKAuthCallback callback) { authCallback = callback; if (Application.isEditor) { AuthWithDebugToken(); return; } if (forceOAuth) { Debug.Log("Auth with OAuth: " + GetAuthUrl()); OAuth(); } else { Debug.Log("Auth with SSO"); SsoAuth(); } }
public static void Auth(OKAuthCallback callback = null) { OdnoklassnikiImpl.Auth(callback); }
public static void RefreshOAuth(OKAuthCallback action) { OdnoklassnikiImpl.RefreshOAuth(action); }
public void RefreshOAuth(OKAuthCallback action) { authCallback = action; if (Application.isEditor) { Debug.Log("Authorization unavailable in Unity Editor"); if (authCallback != null) { authCallback(false); authCallback = null; } return; } if (clearTokenOnAuth) { ClearTokens(false); } authRequested = OKAuthType.OAuth; OpenWebView(GetAuthUrl()); }
public void OAuthFailed(string details) { authRequested = OKAuthType.None; Debug.LogError("Received OAuth failed callback: " + details); if (authCallback != null) { authCallback(false); authCallback = null; } HideWebView(); }