我创建了一个应用程序,以通过关注博文[1]来验证由PINGFederate Server生成的JWT令牌的签名。我通过添加PINGFederate服务器的证书创建了client-truststore.jks文件。
在这一点上,我遇到以下错误-“ return signature.verify(jwtSignature);”
/home/www-data/web2py$ python web2py.py -K <app_name>
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2018
Version 2.15.4-stable+timestamp.2017.09.02.04.02.22
Database drivers available: sqlite3, imaplib, pymysql, pg8000
starting scheduler for "<app_name>"...
Currently running 1 scheduler processes
Traceback (most recent call last):
File "/home/www-data/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "applications/<app_name>/models/scheduler.py", line 28, in <module>
customSSH = local_import('customSSH')
File "/home/www-data/web2py/gluon/compileapp.py", line 444, in <lambda>
local_import_aux(name, reload, app)
File "/home/www-data/web2py/gluon/compileapp.py", line 347, in local_import_aux
module = __import__(name)
File "/home/www-data/web2py/gluon/custom_import.py", line 111, in custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
File "applications/<app_name>/modules/customSSH.py", line 4, in <module>
import multiprocessing
File "/home/www-data/web2py/gluon/custom_import.py", line 111, in custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
File "applications/<app_name>/modules/multiprocessing/__init__.py", line 64, in <module>
import multiprocessing.patch
File "/home/www-data/web2py/gluon/custom_import.py", line 111, in custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named patch
当我打印JWT签名的长度时,我得到256,证书的算法为SHA256withRSA。
我已经调用了“ signature.update”方法。
如何解决此问题?
[1] http://xacmlinfo.org/2015/03/19/validate-and-process-jwt-tokens-with-java/