亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Jhipster 網關需要完全身份驗證才能訪問此資源

Jhipster 網關需要完全身份驗證才能訪問此資源

滄海一幻覺 2021-09-15 14:40:25
大家好,我正在 ubuntu 操作系統上開發 Jhipster。我的項目設置成功完成。但是在嘗試測試 apis 時,它給了我身份驗證錯誤。這是測試 API 時發生的錯誤。如果有人幫助我,我會很高興。錯誤:rExceptionResolver : Resolved exception caused by Handler execution: org.springframework.security.authentication.InsufficientAuthenticationException: Full authentication is required to access this resource網頁瀏覽器{"type" : "https://www.jhipster.tech/problem/problem-with-message","title" : "Unauthorized","status" : 401,"detail" : "Full authentication is required to access this resource","path" : "/api/account","message" : "error.http.401"}
查看完整描述

3 回答

?
米琪卡哇伊

TA貢獻1998條經驗 獲得超6個贊

解決方案:

在這里我得到了解決方案。

Jhipster 用戶創建默認配置的問題。
當我們使用 Jhipster 創建應用程序和實體時,它還會創建用戶身份驗證作為其功能。
但在我的情況下,用戶不是在我在創建過程中選擇的數據庫中創建的。

負責表:-

  1. jhi_user

  2. jhi_user_authority

  3. jhi_authority

因此,我們只需要在這些表中提供 Jhipster 默認用戶的詳細信息。

用戶名:admin
密碼:admin

確保密碼是加密形式。


查看完整回答
反對 回復 2021-09-15
?
茅侃侃

TA貢獻1842條經驗 獲得超22個贊

在我的情況下(在開發配置文件中),我更新了JWT 令牌,在所有應用程序(微服務、網關和注冊表)中更改為 base64,另外,注釋舊屬性“秘密”并使用相同的密鑰。然后從網關正確測試API,沒有授權問題。



查看完整回答
反對 回復 2021-09-15
?
SMILET

TA貢獻1796條經驗 獲得超4個贊

看起來您使用身份驗證執行 JHipster 注冊表,而沒有執行您的應用程序。如果您沒有更改 JHipster jwt 密鑰,您必須使用以下參數執行您的應用程序(微服務):

--spring.security.user.password=admin --jhipster.security.authentication.jwt.secret=my-secret-key-which-should-be-changed-in-production-and-be-base64-encoded --spring.cloud.config.server.composite.0.type=native --spring.cloud.config.server.composite.0.search-locations=file:./central-config

您可以在 application.yml 文件的 central-config 包中找到您的秘密 JWT 密鑰

有關更多詳細信息,請閱讀 JHipster 文檔:https : //www.jhipster.tech/security/#-json-web-tokens-jwt https://www.jhipster.tech/jhipster-registry/


查看完整回答
反對 回復 2021-09-15
  • 3 回答
  • 0 關注
  • 573 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號