public void TestParseAuthHeader() { var authParser = new AuthorizationParser (); var authHeader = "Signature keyId=\"some-key\",algorithm=\"hmac-sha256\",headers=\"date,(request-target)\",signature=\"9MmDJ/7WkGLsBvq9g3/TNhvXgFm5n11j0XqjvF2z9Rc=\""; var auth = authParser.Parse (authHeader); Assert.IsTrue (auth.Algorithm == "hmac-sha256"); Assert.AreEqual (auth.KeyId, "some-key"); }
public void TestParseAuthHeader() { var authParser = new AuthorizationParser(); var authHeader = "Signature keyId=\"some-key\",algorithm=\"hmac-sha256\",headers=\"date,(request-target)\",signature=\"9MmDJ/7WkGLsBvq9g3/TNhvXgFm5n11j0XqjvF2z9Rc=\""; var auth = authParser.Parse(authHeader); Assert.IsTrue(auth.Algorithm == "hmac-sha256"); Assert.AreEqual(auth.KeyId, "some-key"); }
IEnumerator LoginFunc(WWW www) { yield return(www); if (www.error == null) { AuthorizationParser answerWWW = AuthorizationParser.CreateFromJSON(www.text); if (!answerWWW.error) { PlayerPrefs.SetInt("id_user", answerWWW.id_user); PlayerPrefs.SetInt("planetNumber", answerWWW.last_scene); for (int i = 0; i < 10; i++) { PlayerPrefs.SetString("planetProgress" + i.ToString(), answerWWW.planetProgress[i]); } if (answerWWW.last_scene == 10) { PlayerPrefs.SetInt("isAuthorized", 1); SceneManager.LoadScene("UniverseView", LoadSceneMode.Single); } else { PlayerPrefs.SetInt("isAuthorized", 1); SceneManager.LoadScene("SinglePlanetScene", LoadSceneMode.Single); } } else { Debug.Log(answerWWW.errorMessage); } } else { Debug.Log("Error: " + www.error); } }
static HttpSignature() { AuthParser = new AuthorizationParser(); Signer = new HttpSigner(new AuthorizationParser(), new HttpSignatureStringExtractor()); }