devise
上并从我的Rails App中验证它们。这是我在带有Rails
的Congnito上发现的唯一资源,我正在寻找一些示例应用程序或链接到工具或Ruby API文档来实现此目标。 plapease帮助。
根据巴拉答案
AWS cognito
Error堆栈跟踪
require 'aws-sdk'
ENV['AWS_ACCESS_KEY_ID'] = 'XXXXXXXXXXXXXXXXX'
ENV['AWS_SECRET_ACCESS_KEY'] = 'XXXX+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
region_name = 'us-east-1'
endpoint = 'cognito-idp.us-east-1.amazonaws.com'
client = Aws::CognitoIdentityProvider::Client.new(
region: region_name
)
resp = client.admin_create_user({
user_pool_id: "us-east-1_iD7xNHj0x", # required
username: "Test", # required
user_attributes: [
{
name: "email", # required
value: "[email protected]",
},
],
validation_data: [
{
name: "Email", # required
value: "AttributeValueType",
},
],
temporary_password: "PasswordType",
force_alias_creation: false,
message_action: "RESEND", # accepts RESEND, SUPPRESS
desired_delivery_mediums: ["EMAIL"], # accepts SMS, EMAIL
})
update2
home/sachin/.rvm/gems/ruby-2.1.5@global/gems/aws-sdk-core-2.6.38/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call': User does not exist. (Aws::CognitoIdentityProvider::Errors::UserNotFoundException) from /home/sachin/.rvm/gems/ruby-2.1.5@global/gems/aws-sdk-core-2.6.38/lib/aws-sdk-core/plugins/idempotency_token.rb:18:in `call' from /home/sachin/.rvm/gems/ruby-2.1.5@global/gems/aws-sdk-core-2.6.38/lib/aws-sdk-core/plugins/param_converter.rb:20:in `call' from /home/sachin/.rvm/gems/ruby-2.1.5@global/gems/aws-sdk-core-2.6.38/lib/seahorse/client/plugins/response_target.rb:21:in `call' from /home/sachin/.rvm/gems/ruby-2.1.5@global/gems/aws-sdk-core-2.6.38/lib/seahorse/client/request.rb:70:in `send_request' from /home/sachin/.rvm/gems/ruby-2.1.5@global/gems/aws-sdk-core-2.6.38/lib/seahorse/client/base.rb:207:in `block (2 levels) in define_operation_methods' from aws_cognito.rb:20:in `<main>'
首先,您需要为应用程序创建一个用户池
(使用此
link
Internet存档后返回)通过AWS Console创建用户池您可以在
Http://docs.aws.amazon.com/sdkforruby/api/api/api/api/api/cognitoidentityprovider/client.html
eDit