title: Aws Cognito: Secret hash with Java SDK (not Android) and ADMIN_NO_SRP_AUTH flow
body: <p>i try to register a user in my amazon cognito user pool with username and password from my java backend but i always get the error:</p>
  
  <pre><code>Unable to verify secret hash for client
  </code></pre>
  
  <p>in the documentation i don't found any information how to pass the clientSecret in the register request and i don't like to create an (backend) app without a clientSecret.</p>
  
  <p>My code looks like this</p>
  
  <pre><code>identityProvider = AWSCognitoIdentityProviderClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCreds)).withRegion(Regions.EU_CENTRAL_1).build();
  
  Map&lt;String, String&gt; authParameters = new HashMap&lt;&gt;();
  authParameters.put("USERNAME", "username");
  authParameters.put("PASSWORD", "password");
  authParameters.put("SECRET_HASH", "secret copy and paste from the aws console"); // i read in a forum post, that this should work
  
  AdminInitiateAuthRequest authRequest = new AdminInitiateAuthRequest();
  authRequest.withAuthFlow(AuthFlowType.ADMIN_NO_SRP_AUTH);
  authRequest.setAuthParameters(authParameters);
  authRequest.setClientId("clientId");
  authRequest.setUserPoolId("userPoolId");
  
  AdminInitiateAuthResult authResponse = identityProvider.adminInitiateAuth(authRequest);
  </code></pre>
  
  <p>Thanks
  Marcel</p>