You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a Cognito user pool. Added two app clients. One having secret another without secret. Also, added a user to the pool. The documents I am referring mentioned in the Additional Information/Context
Use case
We are planning to integrate Cognito for backend app as auth mechanism. The request contains username/password (due to backward compatibility for legacy systems). Based on the username/password we need to generate an access token using Cognito APIs.
Behavior
In the following code sample listUsers function is working. However, call to adminInitiateAuth always return null response.
Error
java.lang.NullPointerException: Cannot invoke "software.amazon.awssdk.services.cognitoidentityprovider.model.AuthenticationResultType.accessToken()" because the return value of "software.amazon.awssdk.services.cognitoidentityprovider.model.AdminInitiateAuthResponse.authenticationResult()" is null
I am unable to reproduce the issue. Using the code sample you provided. I do get the access token successfully.
Can you please check if the Confirmation status for the Cognito User is Confirmed and not Force change password. You may get the NULL response when the ChallengeName="NEW_PASSWORD_REQUIRED".
You can respond to the challenge using adminRespondToAuthChallenge(). Here's the link to the code example for this use-case.
It looks like this issue has not been active for more than five days. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please add a comment to prevent automatic closure, or if the issue is already closed please feel free to reopen it.
I am unable to reproduce the issue. Using the code sample you provided. I do get the access token successfully.
Can you please check if the Confirmation status for the Cognito User is Confirmed and not Force change password. You may get the NULL response when the ChallengeName="NEW_PASSWORD_REQUIRED".
You can respond to the challenge using adminRespondToAuthChallenge(). Here's the link to the code example for this use-case.
Let me know if this helps.
Regards, Chaitanya
The user confirmation status is already Confirmed. I will try again.
Describe the bug
I have created a Cognito user pool. Added two app clients. One having secret another without secret. Also, added a user to the pool. The documents I am referring mentioned in the
Additional Information/Context
Use case
We are planning to integrate Cognito for backend app as auth mechanism. The request contains username/password (due to backward compatibility for legacy systems). Based on the username/password we need to generate an access token using Cognito APIs.
Behavior
In the following code sample
listUsers
function is working. However, call toadminInitiateAuth
always returnnull
response.Error
java.lang.NullPointerException: Cannot invoke "software.amazon.awssdk.services.cognitoidentityprovider.model.AuthenticationResultType.accessToken()" because the return value of "software.amazon.awssdk.services.cognitoidentityprovider.model.AdminInitiateAuthResponse.authenticationResult()" is null
Code sample
Expected Behavior
As per AWS Cognito document, it should return a response having an access token. Not sure what is missing?
AdminInitiateAuthResponse adminFlowResponse = cognitoClient.adminInitiateAuth(authRequest);
Current Behavior
Following invocation always return null response
AdminInitiateAuthResponse adminFlowResponse = cognitoClient.adminInitiateAuth(authRequest);
Reproduction Steps
ADMIN_USER_PASSWORD_AUTH
typePossible Solution
Not sure but need some advise on what is missing, although the code is based on documentation.
Additional Information/Context
Referring these documents:
AWS Java SDK version used
2.24.1
JDK version used
21
Operating System and version
ubuntu2204-2023-07-25
The text was updated successfully, but these errors were encountered: