使用Google App Engine的Python-Jose

时间:2017-12-14 20:50:24

标签: python google-app-engine jwt python-jose

我正在努力让python-jose与Google App Engine合作。

我添加ImportError: No module named Crypto.Random.OSRNG.winrandom后,我收到错误README.rst

dev_appserver.py中说:

  

这是一个与Google App Engine完全兼容的JOSE实现,需要使用PyCrypto库。

我猜lib/Crypto/Random/OSRNG/winrandom.pyd已将文件// In my activity's onCreate method try { JSONObject obj = new JSONObject(strJSON); new postJSON().execute("https://www.placeholder.com/generate_json", obj.toString()); } catch (Throwable t) { Log.e("JSON Error", "Could not parse malformed JSON: " + strJSON); } // Outside onCreate private class postJSON extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... params) { String data = ""; HttpURLConnection httpURLConnection = null; try { httpURLConnection = (HttpURLConnection) new URL(params[0]).openConnection(); httpURLConnection.setRequestMethod("POST"); httpURLConnection.setDoOutput(true); DataOutputStream wr = new DataOutputStream(httpURLConnection.getOutputStream()); wr.writeBytes("PostData=" + params[1]); wr.flush(); wr.close(); InputStream in = httpURLConnection.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(in); int inputStreamData = inputStreamReader.read(); while (inputStreamData != -1) { char current = (char) inputStreamData; inputStreamData = inputStreamReader.read(); data += current; } } catch (Exception e) { e.printStackTrace(); } finally { if (httpURLConnection != null) { httpURLConnection.disconnect(); } } return data; } @Override protected void onPostExecute(String result) { super.onPostExecute(result); Log.e("TAG", result); } } 屏蔽为非纯Python。

GAE Python runtime environment must be pure Python

我有什么不理解的吗?

0 个答案:

没有答案