title: IdentityTVM responds with error in Amazon iOS SDK sample
body: <p>I am developing an iOS application to use Amazon cloud services(S3 service).</p>
  
  <p>Since i need to authenticate the user, deployed TokenVendingMachine in AWS Elastic BeanStalk as per the steps provided in the <a href="http://aws.amazon.com/code/7351543942956566" rel="nofollow">Token Vending Machine for Identity Registration - Sample Java Web Application</a></p>
  
  <p>But when iam trying to login through TVM, getting an error "signature doesn't matching".</p>
  
  <p>Please see the log from BeanStalk section.</p>
  
  <pre><code> an 29, 2014 6:15:38 AM com.amazonaws.tvm.Utilities getEndPoint
  INFO: Endpoint : &lt;endpoint url&gt;
  Jan 29, 2014 6:15:38 AM com.amazonaws.tvm.identity.LoginServlet processRequest
  INFO: username : &lt;username&gt;
  Jan 29, 2014 6:15:39 AM com.amazonaws.tvm.identity.LoginServlet processRequest
  INFO: timestamp : 2014-01-29T06%3A15%3A38Z
  Jan 29, 2014 6:15:39 AM com.amazonaws.tvm.identity.LoginServlet processRequest
  INFO: uid : 38abccd49ff9f8ffe6c84c466f83ecae
  Jan 29, 2014 6:15:39 AM com.amazonaws.tvm.identity.LoginServlet processRequest
  INFO: endpoint : synopsislibrary.elasticbeanstalk.com
  Jan 29, 2014 6:15:39 AM com.amazonaws.tvm.identity.IdentityTokenVendingMachine validateLoginRequest
  FINE: Timestamp [ 2014-01-29T06:15:38Z ] is valid
  Jan 29, 2014 6:15:39 AM com.amazonaws.tvm.Utilities sign
  SEVERE: Exception during sign
  java.lang.NullPointerException
      at com.amazonaws.tvm.Utilities.sign(Utilities.java:73)
      at com.amazonaws.tvm.custom.UserAuthentication.authenticateUserSignature(UserAuthentication.java:178)
      at com.amazonaws.tvm.identity.IdentityTokenVendingMachine.validateLoginRequest(IdentityTokenVendingMachine.java:174)
      at com.amazonaws.tvm.identity.LoginServlet.processRequest(LoginServlet.java:51)
      at com.amazonaws.tvm.RootServlet.doGet(RootServlet.java:38)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:679)
  Jan 29, 2014 6:15:39 AM com.amazonaws.tvm.identity.IdentityTokenVendingMachine validateLoginRequest
  WARNING: Client signature : e57edd8acbcbbfde0809575acbb5b644ee3713c861276937e35aeee2629129e3 doesnot match with server generated signature .Setting Http status code 401
  </code></pre>
  
  <p>I need clarification on few things</p>
  
  <ol>
  <li><p>Do we need to make any modification on the WAR file associated with IdentityTVM template application? (Assuming, need modification in TokenVendingMachinePolicy.json file, please advice?)</p></li>
  <li><p>Is there any relation between IAM user policy and TVM policy, should we give special attention to these sections while creating TVM in elastic beanstalk?</p></li>
  </ol>
  
  <p>Please help.</p>
  
  <p>Thanks in advance. </p>