title: How to use devise and aws cognito in rails 3
body: <p>I'm using rails 3.2 and devise 3.2.3. I'm trying to use AWS Cognito Developer Authenticated Identities and find myself lost on how to do it.</p>
  
  <p>Our users have to be authenticated. How can I use Custom for the Authentication provider in the Identity pool if I'm using Devise gem?</p>
  
  <p>I'm already using aws-sdk v1 and installed the v2 gem to support cognito.</p>
  
  <pre><code>gem 'aws-sdk-resources', '~&gt; 2'
  </code></pre>
  
  <p>I saw this post <a href="https://stackoverflow.com/questions/26704404/upload-to-amazon-s3-and-calling-amazon-cognito-identity-from-rails-server">Upload to Amazon S3 and Calling Amazon Cognito Identity from Rails server</a> but don't know where to place the block below if it is correct.</p>
  
  <pre><code>require 'aws-sdk'
  cognito = Aws::CognitoIdentity::Client.new(region:'us-east-1')
  resp = cognito.get_open_id_token_for_developer_identity(
             identity_pool_id: 'IDENTITY_POOL_ID', 
             logins: {'MY_PROVIDER_NAME' =&gt; 'USER_IDENTIFIER'})
  </code></pre>