久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

invalid_grant:AADSTS50126:由于用戶名或密碼無效,驗證

invalid_grant: AADSTS50126: Error validating credentials due to invalid username or password(invalid_grant:AADSTS50126:由于用戶名或密碼無效,驗證憑據時出錯)
本文介紹了invalid_grant:AADSTS50126:由于用戶名或密碼無效,驗證憑據時出錯的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試從我的 Java 代碼中向 https://login.microsoftonline.com/<My_Tenant_Id>/oauth2/token 發送發布請求,但我收到了錯誤 invalid_grant:AADSTS50126:由于用戶名或密碼無效,驗證憑據時出錯".我已經驗證了憑據并且它們是正確的(我能夠登錄到 Azure 門戶并查看我的 AWS APP for SSO).我什至嘗試從郵遞員那里提出相同的要求,但也遇到了同樣的問題.

I am trying to hit a post request to https://login.microsoftonline.com/<My_Tenant_Id>/oauth2/token from my Java Code, but I am getting the error "invalid_grant: AADSTS50126: Error validating credentials due to invalid username or password". I have verified the credentials and they are correct (I am able to login to Azure portal and see my AWS APP for SSO). I even tried hitting the same request from postman, but then also same issue.

我傳遞的參數是:

"grant_type", "password"
"requested_token_type","urn:ietf:params:oauth:token-type:saml2"
"username", username
"password", password
"client_secret", clientSecret
"client_id", clientId
"resource", clientId

我什至檢查了各種 Microsoft 文檔,但仍然無法解決問題.任何人都可以告訴可能是什么問題.是 API 調用錯誤還是服務器設置錯誤.

I have even checked various Microsoft Documentations but I am still not able to resolve the issue. Can anybody tell what might be the issue. is the API call wrong or the server setup is wrong.

請注意:最初我的 API 調用正常,但后來我收到一個錯誤 invalid_request: AADSTS80014 然后它自動得到解決,我開始收到 invalid_grant: AADSTS50126.有沒有人遇到過這個問題或知道如何解決這個問題.謝謝!

Please note: Initially my API call was working, but then I got an error invalid_request: AADSTS80014 then it automatically got resolved and I started getting invalid_grant: AADSTS50126. Has anybody faced this issue or knows how to fix this. Thanks!

推薦答案

我可以通過創建一個僅限云的用戶來解決這個問題.聯合用戶使用資源所有者密碼授予流程失敗的原因是,對于聯合用戶,Azure AD 必須將用戶重定向到屬于用戶的本地域的特定聯合服務器,以便 ADFS 服務器可以關閉身份驗證與本地域控制器.在資源所有者密碼授權流程中,此重定向是不可能的,因此它無法驗證用戶名和密碼,從而導致該錯誤.

I am able to resolve this by creating a cloud only user. The reason a federated user fails with the Resource Owner Password Grant flow is because for a federated user Azure AD has to redirect the user to the specific federation Server that belongs to the user's on-prem domain so that the ADFS server can get the auth down with the local domain controller. In Resource Owner Password grant flow this redirect is not possible hence it is not able to validate the username and password and hence that error.

作為建議,我們可以創建一個新的僅云用戶,其用戶名和密碼應駐留在 Azure AD 中,以便在使用資源所有者密碼授予流程時,我們提交用戶的憑據,AAD 無需任何重定向即可對用戶進行身份驗證.

As a suggestion, we can create a new cloud only user whose username and password should reside in Azure AD, so that when using Resource Owner password Grant flow we submit the user's credentials, AAD can authenticate the user without any redirections.

此用戶可以是 AAD 中的普通用戶,并且相應的委派權限應存在于應用注冊中.現在要確保的另一件事是,如果我們提供的委派權限需要管理員同意,那么在用戶登錄應用程序之前,管理員必須向此委派權限提供管理員同意.如果我們希望用戶提供他/她自己的同意(如果委派的權限需要用戶同意),那么我們必須在繼續資源所有者密碼授予流程之前以某種方式提供用戶同意.

This user can be a normal user in AAD and the respective delegated permissions should be present in the app registration. Now one more thing to make sure is, if the delegated permission that we are providing needs admin consent then before the user logs in to the application, the admin has to provide the admin consent to this delegated permission. If we want to the user to provide his/her own consent (if the delegated permission needs user consent) then we would have to somehow provide the user consent before going ahead with the Resource Owner Password Grant Flow.

這篇關于invalid_grant:AADSTS50126:由于用戶名或密碼無效,驗證憑據時出錯的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Why does the android emulator camera stop unexpectedly?(為什么android模擬器相機會意外停止?)
Android camera , onPictureTaken(byte[] imgData, Camera camera) method amp; PictureCallback never called(Android camera , onPictureTaken(byte[] imgData, Camera camera) 方法 amp;PictureCallback 從未調用過) - IT屋-程序員軟件開發技
Understanding the libGDX Projection Matrix(了解 libGDX 投影矩陣)
QR code reading with camera - Android(使用相機讀取二維碼 - Android)
IP camera with OpenCv in Java(Java中帶有OpenCv的IP攝像頭)
Android mock Camera(Android 模擬相機)
主站蜘蛛池模板: 日本成人一区二区 | 男女羞羞视频在线看 | 国产999精品久久久影片官网 | jlzzjlzz国产精品久久 | 亚洲三级国产 | 日韩不卡三区 | 免费精品视频在线观看 | 日韩国产中文字幕 | 国产精品久久久久久吹潮 | 欧美成人免费在线视频 | 久久久久无码国产精品一区 | 午夜爱爱毛片xxxx视频免费看 | 国产精品中文字幕一区二区三区 | 国产精品久久久久久久久大全 | 国产精品视频久久久久久 | 国产91色在线 | 亚洲 | 欧美一区二区大片 | 国产一区二区三区久久久久久久久 | 国产综合av | 日韩综合在线播放 | 中文字幕二区 | 久久亚洲精品国产精品紫薇 | 久久久激情 | 国产成人网 | 欧美一级淫片007 | 日韩精品视频在线播放 | 国产一区二区久久 | 久久久久久久亚洲精品 | 国产99精品 | 国产亚洲一区二区三区在线观看 | 午夜精品久久久久久久久久久久久 | 精品乱码一区二区三四区视频 | 国际精品鲁一鲁一区二区小说 | 草久视频| 久久毛片 | 日本激情视频网 | 久久久久久久久91 | 999免费视频 | 午夜免费视频观看 | 欧美国产日韩在线观看 | 亚洲第一av |