# JWT::InvalidIssuerError on Decode JWT (OpenID Connect)

**URL:** https://meta.discourse.org/t/jwt-invalidissuererror-on-decode-jwt-openid-connect/231268
**Category:** Support
**Tags:** openid-connect
**Created:** [2022 年 6 月 27 日午後 8:58 UTC](https://meta.discourse.org/t/jwt-invalidissuererror-on-decode-jwt-openid-connect/231268 "2022-06-27T20:58:08Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Alexander](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexander/32/497634_2.png) [@Alexander](https://meta.discourse.org/u/Alexander)
#### Post date: [2022 年 6 月 27 日午後 8:58 UTC](https://meta.discourse.org/t/jwt-invalidissuererror-on-decode-jwt-openid-connect/231268/1 "2022-06-27T20:58:08Z")

</div>

こんにちは:wave:！こんにちは、OpenID Connectプラグインについて質問があります。

DiscourseでID Uruguay（政府提供のOpenID Connect「プロバイダー」）を使用しようとしています。テストサーバーにサインアップし、必要なデータを受け取りました。

コールバックを除いて、すべてのフローは正常に機能しているように見えます。JWTで送信された発行者が、ディスカバリードキュメントのものと同じではないようです。  
すでにサポートに連絡しましたが、彼らは基本的にDiscourse側のエラーだと言いました（私はそうは思いません）。

「期待される発行者」に別の値を追加することは可能ですか？

ディスカバリー ドキュメント: [https://auth-testing.iduruguay.gub.uy/oidc/v1/.well-known/openid-configuration](https://auth-testing.iduruguay.gub.uy/oidc/v1/.well-known/openid-configuration)

> **ログ**
>
> ```plaintext
> OIDC Log: JWT を読み込みました
> 
> ---
> iss: https://auth-testing.iduruguay.gub.uy/oidc/v1
> sub: '7630'
> aud: '862271'
> exp: 1656363519
> iat: 1656362919
> auth_time: 1656362918
> amr:
> - urn:iduruguay:am:password
> acr: urn:iduruguay:nid:1
> nonce: 94d556d732db0db8dff0e09a174c27f2943cfe1740845abf537ff768e96c8ddf
> at_hash: eokMw_xDlqb6cXB-DkDA_A
> pais_documento:
> codigo: uy
> nombre: Uruguay
> tipo_documento:
> codigo: 68909
> nombre: C.I.
> numero_documento: '54682086'
> email: alexander.barrios@estudiante.ceibal.edu.uy
> email_verified: true
> name: Yanquis Alexander Barrios Espíndola
> given_name: Yanquis Alexander
> family_name: Barrios Espíndola
> nickname: uy-ci-54682086
> idp: Usuario gub.uy
> 
> ```
> 
> `(oidc) 認証エラー！jwt_decode_failed: JWT::InvalidIssuerError, 無効な発行者。期待値 ["https://auth-testing.iduruguay.gub.uy"]、受信値 https://auth-testing.iduruguay.gub.uy/oidc/v1`

* * *

事前に感謝いたします！🤗

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2022 年 6 月 27 日午後 10:10 UTC](https://meta.discourse.org/t/jwt-invalidissuererror-on-decode-jwt-openid-connect/231268/2 "2022-06-27T22:10:21Z")

</div>

Hmm.

発見ドキュメントの場所から、発行者は `https://auth-testing.iduruguay.gub.uy/oidc/v1` であると想定する必要があります。発見ドキュメントは、`/.well-known/openid-configuration` が追加された発行者であるためです。

次に、ドキュメント自体には `issuer\t\"https://auth-testing.iduruguay.gub.uy\"` と記載されています。

そして、[OpenID Connect Discovery ドキュメント](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationValidation) には次のように記載されています。

> [@](#):
>
> 4.3. OpenID Provider Configuration Validation
> 
> If any of the validation procedures defined in this specification fail, any operations requiring the information that failed to correctly validate MUST be aborted and the information that failed to validate MUST NOT be used.
> 
> The issuer value returned MUST be identical to the Issuer URL that was directly used to retrieve the configuration information. This MUST also be identical to the iss Claim value in ID Tokens issued from this Issuer.

そして、最後の文の 2 つの要件が満たされていません。`iss` クレーム値は、構成を取得するために直接使用された発行者 URL と同一ですが、どちらも返された `issuer` 値と同一ではありません。

したがって、私の意見では、彼らは間違っており、あなたは正しいです。残念ながら、それはどこにも行きません。

---

<div class="post-metadata">

### Author: ![Alexander](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexander/32/497634_2.png) [@Alexander](https://meta.discourse.org/u/Alexander)
#### Post date: [2022 年 6 月 27 日午後 10:34 UTC](https://meta.discourse.org/t/jwt-invalidissuererror-on-decode-jwt-openid-connect/231268/3 "2022-06-27T22:34:28Z")

</div>

> [@RGJ](#):
>
> > [@](#):
> >
> > 発行者の値は、設定情報を直接取得するために使用された発行者のURLと同一でなければなりません。また、この発行者から発行されたIDトークンのissクレーム値とも同一でなければなりません。

面白い事実ですね、知りませんでした 🤔

これを報告し、あなたの回答にリンクしました。IDウルグアイのサポートからの返信を待ちます 😴。

現在、正しい発行者を持つpastebinを使用しています（いずれにせよ、テスト用でした）が、すべて正常に機能しているようです。サポートチームが本番モードでIDウルグアイに適用する前に、この詳細を解決できることを願っています。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2022 年 6 月 28 日午前 6:16 UTC](https://meta.discourse.org/t/jwt-invalidissuererror-on-decode-jwt-openid-connect/231268/4 "2022-06-28T06:16:59Z")

</div>

> [@Alexander](#):
>
> 現在、正しい発行者を持つpastebinを使用しています。

仕様によると、これは機能するはずなので驚いています。

> [@](#):
>
> 発行者の値は、構成情報を取得するために直接使用された発行者URLと同一でなければなりません。

---

<div class="post-metadata">

### Author: ![Alexander](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexander/32/497634_2.png) [@Alexander](https://meta.discourse.org/u/Alexander)
#### Post date: [2022 年 6 月 28 日午後 2:49 UTC](https://meta.discourse.org/t/jwt-invalidissuererror-on-decode-jwt-openid-connect/231268/5 "2022-06-28T14:49:34Z")

</div>

さて、回答を得ましたが、彼らは「自分たちの側には問題がなく、広く使われている」という理由で修正してくれません 🙂

ドキュメントにはJWTをチェックする方法が見当たらないので、それが「うまくいく」理由なのでしょうね 🤔

ドキュメント (Google翻訳):  
[https://centroderecursos-agesic-gub-uy.translate.goog/web/seguridad/wiki/-/wiki/Main/ID+Uruguay+-+Integración+con+OpenID+Connect?\_x\_tr\_sl=es&\_x\_tr\_tl=en&\_x\_tr\_hl=es&\_x\_tr\_pto=wapp](https://centroderecursos-agesic-gub-uy.translate.goog/web/seguridad/wiki/-/wiki/Main/ID+Uruguay+-+Integraci%C3%B3n+con+OpenID+Connect?_x_tr_sl=es&_x_tr_tl=en&_x_tr_hl=es&_x_tr_pto=wapp)

* * *

ディスカバリー文書のために「[プロキシ](https://proxy-id-uruguay.rinconestudiantil.ml/.well-known/openid-configuration)」を作成し、返される発行者を変更したところ、それも「うまくいく」ので、これを報告したところ、彼らは受け入れてくれました 🙂

将来的に仕様に従っていないため失敗するのではないかと感じていますが、今のところは大丈夫です。

手伝ってくれたリチャード、ありがとう！ 🤗

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2022 年 7 月 28 日午後 2:50 UTC](https://meta.discourse.org/t/jwt-invalidissuererror-on-decode-jwt-openid-connect/231268/6 "2022-07-28T14:50:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
