amazon-cognito

How to handle with token expiration on Cognito

天大地大妈咪最大 提交于 2019-12-31 13:48:16
问题 I am developing an application that uses AWS Cognito as the Identity Provider. So the user authenticate on AWS Cognito Pool and get the Access Token, Access ID and Refresh token. Then the user can make backend requests to my app. I get the Access Token validate it, get the user profile on Cognito AWS and authorize the request. The problem is that after the Access token has expired, and the client send the expired token to the backend, the backend app get an error (token experied or not

How to handle with token expiration on Cognito

独自空忆成欢 提交于 2019-12-31 13:47:53
问题 I am developing an application that uses AWS Cognito as the Identity Provider. So the user authenticate on AWS Cognito Pool and get the Access Token, Access ID and Refresh token. Then the user can make backend requests to my app. I get the Access Token validate it, get the user profile on Cognito AWS and authorize the request. The problem is that after the Access token has expired, and the client send the expired token to the backend, the backend app get an error (token experied or not

How to persist Cognito identity across pages in browser

牧云@^-^@ 提交于 2019-12-31 13:44:22
问题 I am authenticating through Cognito on client side browser using a developer authenticated identity. When my page loads (or is refreshed) I would like my application to remember the Identity for as long as the object is not expired (I think it lasts about an hour). However, I don't know how to retrieve the identity from Cognito without having to go through the developer authentication again. Here is what the code does on page load: var cognitoCredentials $(document).ready(function() { "use

IAM Policy for S3 folder access based on Cognito ID

点点圈 提交于 2019-12-31 09:30:49
问题 I have created an IAM policy to allow Cognito users to write to my S3 bucket, but I would like to restrict them to folders based on their Cognito ID. I've followed Amazon's instructions here and created a policy that looks like this: { "Effect": "Allow", "Action": ["s3:PutObject","s3:GetObject"], "Resource": [ "arn:aws:s3:::mybucket/myappfolder/${cognito-identity.amazonaws.com:sub}*" ] } But when I try to upload using the v2 of the AWS iOS SDK I get an access denied error. If I modify the

AWS Cognito Custom Attributes Not Created

坚强是说给别人听的谎言 提交于 2019-12-31 05:21:13
问题 I am trying to setup a Cognito user using the AWS Cognito SDK and am having trouble adding custom attributes to a user. I have ensured that the variable names match up exactly and that the application allows read/write on all of the attributes. My code looks like this: var attributeList = []; var dataName = { Name: 'name', Value: name }; var dataPhoneNumber = { Name: 'phone_number', Value: phone }; var dataIsDriver = { Name: 'custom:is_driver', Value: 0 }; var attributeName = new AWSCognito

AWS - Unauthenticated access is not supported for this identity pool in swift.

南笙酒味 提交于 2019-12-31 03:34:07
问题 I have custom UI for Signup and Singing so not using AWSAuthUI I was able to successfully setup Signup by following the documentation and am able to see confirm users in the user pool. I am facing issue in DynamoDB Access (Authentication issue) Bellow is the code is am using for Login @IBAction func btn_login(_ sender: UIButton) { ActivityIndicator.start() if(txt_soul_id.text != "" && txt_pwd.text != ""){ let emailTextField = txt_soul_id.text! let passwordTextField = txt_pwd.text! let len =

AWS IoT Android application over MQTT throws MqttException (0) - java.io.IOException: Already connected

依然范特西╮ 提交于 2019-12-30 10:19:28
问题 I am trying to use 'Authenticate using Cognito-Identity with Cognito user pool' in my Android application. My Cognito user pool authentication works well, when I run that separately and I had seen a JWTToken as well. When I run the the 'PubSub' sample application with Unauthenticated role, it worked as expected. When I integrate these two features in one application, the application threw following error. W/System.err: MqttException (0) - java.io.IOException: Already connected W/System.err:

How can one make authenticated requests with AWS Cognito from mobile to AWS services (i.e. CloudSearch)?

浪子不回头ぞ 提交于 2019-12-30 05:16:08
问题 I've read a bunch of AWS documentation in the last day or two, but haven't yet come across anything that really answers the follow: If a mobile app is using AWS Cognito as the Authentication / Identity provider, I know that we can write AWS IAM policies that specify what AWS resources and actions a user can take. There are a brief few examples of policies that allow users to upload files to S3 directly, but only into "folders" named with their user identity. There is plenty of mention of

Cognito User Pool: How to refresh Access Token using Refresh Token

拈花ヽ惹草 提交于 2019-12-29 11:33:32
问题 I am using Cognito user pool to authenticate users in my system. A successful authentication gives an ID Token (JWT) , Access Token (JWT) and a Refresh Token . The documentation here, clearly mentions that the refresh token can be used to refresh access token, but does not mention how. My question is once my Access Token expires, how do I use the stored refresh token to refresh my access token again? I searched through the JavaScript SDK and could not find any method to do the same. I

AWS Cognito user authentication Missing required parameter SRP_A

南笙酒味 提交于 2019-12-29 08:56:32
问题 I am trying to use AWS Cognito services for user authentication through ruby SDK. I could able to sign_up, confirm sign_up process using the methods resp = client.sign_up({ client_id: "ClientIdType", secret_hash: "SecretHashType", username: "UsernameType", password: "PasswordType", user_attributes: [{ name:"AttributeNameType", value: "AttributeValueType", }], validation_data: [{ name: "AttributeNameType", value: "AttributeValueType", }] }) and confirm_sign_up using resp = client.confirm_sign