title: How to configure AWS user cognito authentication flow for generating identity token,access token in Java sdk backend?
body: <ol>
  <li>I am using AWS Cognito authentication for signing mechanism. In order to obtain the credentials(access,secret and session token), we need to obtain identity token.</li>
  <li>I am having username,password,clientId,userPoolId,identityPoolId information. However,when I try to generate the id token using USER_PASSWORD_AUTH as auth flow type I am getting the below error
  <strong><strong>Caused by: com.amazonaws.services.cognitoidp.model.AWSCognitoIdentityProviderException: Missing Authentication Token (Service: AWSCognitoIdentityProvider; Status Code: 400; Error Code: MissingAuthenticationTokenException; Request ID: ; Proxy: null)</strong></strong></li>
  </ol>
  <p><strong>Below is the code:</strong></p>
  <pre><code>AnonymousAWSCredentials awsCreds = new AnonymousAWSCredentials();
  
      AWSCognitoIdentityProvider provider = AWSCognitoIdentityProviderClientBuilder.standard()
              .withCredentials(new AWSStaticCredentialsProvider(awsCreds))
              .withRegion(//region)
              .build();
             
  
      AdminInitiateAuthRequest authRequest = new AdminInitiateAuthRequest()
              .withAuthFlow(AuthFlowType.USER_PASSWORD_AUTH)
              .withClientId(&quot;&quot;)
              .withUserPoolId(&quot;&quot;)
              .withAuthParameters(map);
      Map&lt;String,String&gt; map = new HashMap&lt;&gt;();
      map.put(&quot;USERNAME&quot;,&quot;&quot;);
      map.put(&quot;PASSWORD&quot;,&quot;&quot;);
  </code></pre>
  <p>Here map will have username and password.</p>
  <p>Can someone help on how to configure authentication in Java in order to generate the id token and access token? Thanks in advance!!</p>