错误ReferenceError:未定义KEYUTIL

时间:2017-06-11 01:43:41

标签: identityserver4

我一直在关注this教程,到目前为止一直很好,只是我在成功登录后仍然收到此错误或看起来像是

ERROR ReferenceError: KEYUTIL is not defined
at OidcSecurityValidation.validate_signature_id_token (oidc.security.validation.ts:152)
at SafeSubscriber._next (oidc.security.service.ts:116)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
at SafeSubscriber.next (Subscriber.js:185)
at Subscriber._next (Subscriber.js:125)
at Subscriber.next (Subscriber.js:89)
at CatchSubscriber.Subscriber._next (Subscriber.js:125)
at CatchSubscriber.Subscriber.next (Subscriber.js:89)
at MapSubscriber._next (map.js:83)
at MapSubscriber.Subscriber.next (Subscriber.js:89)
defaultErrorLogger @ core.es5.js:1084
ErrorHandler.handleError @ core.es5.js:1144
next @ core.es5.js:4778
schedulerFn @ core.es5.js:3851
SafeSubscriber.__tryOrUnsub @ Subscriber.js:238
SafeSubscriber.next @ Subscriber.js:185
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ core.es5.js:3837
NgZone.triggerError @ core.es5.js:4209
onHandleError @ core.es5.js:4170
ZoneDelegate.handleError @ zone.js:395
Zone.runTask @ zone.js:194
ZoneTask.invoke @ zone.js:486

我尝试了教程中指定的方法,但没有用。我在vendor.ts中以这种方式导入文件import "./assets/jsrsasign.min.js"它也没有帮助。

1 个答案:

答案 0 :(得分:1)

好的,这就是我要做的事情。如果您使用的是webpack 2(这就是我正在使用的)

添加以下内容(取决于您的文件夹安排)

new CopyWebpackPlugin([
       { from: './angularApp/assets/*.*', to: 'assets/', flatten: true }
    ]),

然后像我一样在我的index.html中引用

<script src="assets/jsrsasign.min.js"></script>

部分的最后一行