samedi 5 septembre 2015

How to use devise and aws cognito in rails 3

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.

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?

I'm already using aws-sdk v1 and installed the v2 gem to support cognito.

gem 'aws-sdk-resources', '~> 2'

I saw this post Upload to Amazon S3 and Calling Amazon Cognito Identity from Rails server but don't know where to place the block below if it is correct.

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' => 'USER_IDENTIFIER'})




Aucun commentaire:

Enregistrer un commentaire