第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

AWS Cognito InitiateAuth 通過 Lambda 函數(shù)導(dǎo)致錯誤

AWS Cognito InitiateAuth 通過 Lambda 函數(shù)導(dǎo)致錯誤

Go
動漫人物 2023-06-12 15:50:32
我正在 Go 中編寫一個 Lambda 函數(shù)來對用戶進(jìn)行身份驗證,這是我想用于后續(xù) API 調(diào)用的 AccessToken/IdToken。當(dāng)我從一個獨立程序執(zhí)行 Go 代碼時,它起作用了,InitiateAuth 成功了。當(dāng)我嘗試使用來自 lambda 函數(shù)的相同代碼時,出現(xiàn)錯誤 NotAuthorizedException: Unable to verify secret hash for client ......這是我正在使用的代碼片段func AuthenticateUser(userName string, passWord string) (*cognitoidentityprovider.InitiateAuthOutput, error) {    username := aws.String(userName)    password := aws.String(passWord)    clientID := aws.String(constants.COGNITO_APP_CLIENT_ID)    params := &cognitoidentityprovider.InitiateAuthInput{        AuthFlow: aws.String("USER_PASSWORD_AUTH"),        AuthParameters: map[string]*string{            "USERNAME": username,            "PASSWORD": password,        },        ClientId: clientID,    }    authResponse, authError := cognitoClient.InitiateAuth(params)    if authError != nil {        fmt.Println("Error = ", authError)        return nil, authError    }    fmt.Println(authResponse)    fmt.Println(*authResponse.Session)    return authResponse, nil}我已經(jīng)為 lambda 用戶提供了足夠的權(quán)限 - cognito-idp:AdminCreateUser - cognito-idp:AdminDeleteUser - cognito-idp:InitiateAuth - cognito-idp:ChangePassword - cognito-idp:AdminRespondToAuthChallenge - cognito-idp:AdminInitiateAuth - cognito-idp:確認(rèn)忘記密碼我在這里錯過了什么嗎?
查看完整描述

1 回答

?
達(dá)令說

TA貢獻(xiàn)1821條經(jīng)驗 獲得超6個贊

當(dāng)我們創(chuàng)建一個新的 App 客戶端時,默認(rèn)情況下它有一個關(guān)聯(lián)的 App 客戶端密碼。

我又創(chuàng)建了一個沒有“Client Secret”的應(yīng)用程序客戶端。我使用了這個新的 App 客戶端。

我修改了代碼以使用 API AdminInitiateAuth,而不是 InitiateAuth

我能夠成功登錄。


查看完整回答
反對 回復(fù) 2023-06-12
  • 1 回答
  • 0 關(guān)注
  • 159 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號