aws-cognito-angular-quickstart icon indicating copy to clipboard operation
aws-cognito-angular-quickstart copied to clipboard

An Angular(v5)-based QuickStart single-page app utilizing Amazon Cognito, S3, and DynamoDB (Serverless architecture)

Results 38 aws-cognito-angular-quickstart issues
Sort by recently updated
recently updated
newest added

./createResources.sh fails to apply policies

[{"_id":"637e9a07bc25e83db0084d61","body":"I hit this when I had '-' character in my project name. I got past it by removing all special characters.","issue_id":1660211071403,"origin_id":389397339,"user_origin_id":133071,"create_time":1526447947,"update_time":1526447947,"id":1669241351370,"updated_at":"2022-11-23T22:09:11.369000Z","created_at":"2022-11-23T22:09:11.369000Z"}] comment

When using the `createResources.sh` script, it's failing to capture the generated pool ids required for later commands. Example output: ``` → ./createResources.sh Enter the name for your resources (must be...

UserLoginService.logout() does not effectively sign out if Local Storage is used

[{"_id":"637e96d65ae95c7a222dcba3","body":"Hi, where do you applied the code?\r\n\r\nI am having an issue, the session is not closing when I close the browser. I open the browser after two or three days and the session is active.\r\n\r\nI don't know if your code apply for my issue.","issue_id":1660211071407,"origin_id":386898194,"user_origin_id":38407321,"create_time":1525629105,"update_time":1525629105,"id":1669240534727,"updated_at":"2022-11-23T21:55:34.726000Z","created_at":"2022-11-23T21:55:34.726000Z"}] comment

I had a pretty simple use case where I just wanted to logout. When I route to /logout, the LogoutComponent calls the UserLoginService's logout() method. However, this then reroutes to...

Replace callbacks with Behavioral Subjects

[{"_id":"637e89b04b97542c9a2e5d40","body":"+1 \r\n\r\nI've used parts of this code (which is great, BTW) for CUP authentication to API Gateway in a web app where I'm using Observables to communicate to my API sending the ID Token retrieved from Cognito and was wondering the same thing: would it be possible to use Observables to make the calls to Cognito?","issue_id":1660211071410,"origin_id":262850896,"user_origin_id":12226594,"create_time":1480026028,"update_time":1480026028,"id":1669237168313,"updated_at":"2022-11-23T20:59:28.312000Z","created_at":"2022-11-23T20:59:28.312000Z"},{"_id":"637e89b04b97542c9a2e5d41","body":"Hi @mwawrusch & @awsed , \r\n\r\nI completely agree -- there's a lot of tight coupling and that's not optimal. I'm looking at ways to remove this complexity. \r\n\r\nThanks,\r\nVladimir\r\n","issue_id":1660211071410,"origin_id":263041771,"user_origin_id":2776052,"create_time":1480131003,"update_time":1480131003,"id":1669237168322,"updated_at":"2022-11-23T20:59:28.321000Z","created_at":"2022-11-23T20:59:28.321000Z"},{"_id":"637e89b04b97542c9a2e5d42","body":"Any update on this?\r\nWe had to do a lot of changes to convert to observables and we never quite figured out a clean way to handle token refresh (or request resubmitting on error....)\r\nI'm looking to start another project soon it it would be nice to have a clean starting point.\r\n\r\nThanks!","issue_id":1660211071410,"origin_id":271442292,"user_origin_id":11902570,"create_time":1484004967,"update_time":1484004967,"id":1669237168339,"updated_at":"2022-11-23T20:59:28.339000Z","created_at":"2022-11-23T20:59:28.339000Z"},{"_id":"637e89b04b97542c9a2e5d43","body":"Hi @wmagda , \r\n\r\nI'm looking into this but there's no definite plan at this time. \r\n\r\nThanks,\r\nVladimir\r\n","issue_id":1660211071410,"origin_id":271567251,"user_origin_id":2776052,"create_time":1484052596,"update_time":1485204133,"id":1669237168342,"updated_at":"2022-11-23T20:59:28.342000Z","created_at":"2022-11-23T20:59:28.342000Z"},{"_id":"637e89b04b97542c9a2e5d44","body":"+1\r\n\r\nThank you for the great starting template!\r\n\r\nI'm looking into the code, and my previous experience on Angular 2 has been mostly using Observables, which is clearer and more intuitive.\r\n\r\nThanks!","issue_id":1660211071410,"origin_id":275014577,"user_origin_id":15947070,"create_time":1485317564,"update_time":1485317564,"id":1669237168345,"updated_at":"2022-11-23T20:59:28.345000Z","created_at":"2022-11-23T20:59:28.345000Z"},{"_id":"637e89b04b97542c9a2e5d45","body":"@robertbrower-technologies, \r\n\r\nYou might want to create a new question and add more details. This issue is for a different topic. \r\n\r\nVladimir","issue_id":1660211071410,"origin_id":281137403,"user_origin_id":2776052,"create_time":1487611461,"update_time":1487611461,"id":1669237168348,"updated_at":"2022-11-23T20:59:28.348000Z","created_at":"2022-11-23T20:59:28.348000Z"},{"_id":"637e89b04b97542c9a2e5d46","body":"Any interest in a pull request where the components and services are refactored to Observables? (I haven't done this yet. I'm just checking the waters to see if that is a goal for your project). Once it's using Observables, unit testing could be implemented as well.","issue_id":1660211071410,"origin_id":281217578,"user_origin_id":702031,"create_time":1487639475,"update_time":1487639475,"id":1669237168353,"updated_at":"2022-11-23T20:59:28.352000Z","created_at":"2022-11-23T20:59:28.352000Z"},{"_id":"637e89b04b97542c9a2e5d47","body":"Hi @taji , \r\n\r\nYes, PRs are definitely welcome!\r\n\r\nThanks,\r\nVladimir","issue_id":1660211071410,"origin_id":281698588,"user_origin_id":2776052,"create_time":1487776630,"update_time":1487776630,"id":1669237168356,"updated_at":"2022-11-23T20:59:28.355000Z","created_at":"2022-11-23T20:59:28.355000Z"},{"_id":"637e89b04b97542c9a2e5d48","body":"Busy week so I'm a bit late replying. Okay, I've done a bit of refactoring of this project to observables. I'm still not sure I have the bandwidth, but if I (or someone else) decide(s) to contribute, I think this undertaking should have some coordination to ensure it comes off properly. The project should be broken down into smaller pull requests that are easy to submit and accept. As a basic plan, I see this:\r\n\r\n1. Convert AWS SDK and Cognito SDK global references to proper typescript module imports using the typings here: (https:\/\/github.com\/aws\/aws-sdk-js\/tree\/support\/typescript\/typings). I think this would make a difference with mocking when unit tests are implemented with the observables.\r\n\r\n2. Convert the javascript callback code to observables at the component and service levels. It would be a good idea to add karma\/jasmine test configuration so that Angular CLI can run the tests. I recommend refactoring a single component and service class with unit tests and then submitting that for review before refactoring all of the components and services. \r\n\r\n3. Another concern is how much change is coming to this project and how to ensure the refactoring doesn't fall out of sync with the new changes. \r\n\r\nLike I said, it may not be me, but it's a significant change and whoever does it should have a good roadmap. \r\n\r\nYour thoughts?","issue_id":1660211071410,"origin_id":282527375,"user_origin_id":702031,"create_time":1488075515,"update_time":1488075515,"id":1669237168377,"updated_at":"2022-11-23T20:59:28.377000Z","created_at":"2022-11-23T20:59:28.377000Z"},{"_id":"637e89b04b97542c9a2e5d49","body":"Hi @taji , thanks for sharing the roadmap proposal. If you want to do some refactoring to observables feel free to start small with one Service or Component. Once you're comfortable doing a PR, pull the trigger and I'll review it. That's probably the most efficient way of tackling this, if you want to. In regards to the rate of changes -- taking it a step at a time should alleviate some of your concerns. ","issue_id":1660211071410,"origin_id":282536409,"user_origin_id":2776052,"create_time":1488090510,"update_time":1488090510,"id":1669237168389,"updated_at":"2022-11-23T20:59:28.388000Z","created_at":"2022-11-23T20:59:28.388000Z"},{"_id":"637e89b04b97542c9a2e5d4a","body":"Sounds good :)","issue_id":1660211071410,"origin_id":282555643,"user_origin_id":702031,"create_time":1488115395,"update_time":1488115395,"id":1669237168393,"updated_at":"2022-11-23T20:59:28.393000Z","created_at":"2022-11-23T20:59:28.393000Z"},{"_id":"637e89b04b97542c9a2e5d4b","body":"I'm beginning to address this in a couple of PR's. Using an Observable to control a single session object is a bit of overkill IMO ( unless you really do want everything on the planet to be a stream ). My approach is going to be to use Promises for the session object, then Observables for the DynamoDB interactions.","issue_id":1660211071410,"origin_id":312785320,"user_origin_id":5297213,"create_time":1499146947,"update_time":1499146947,"id":1669237168397,"updated_at":"2022-11-23T20:59:28.397000Z","created_at":"2022-11-23T20:59:28.397000Z"},{"_id":"637e89b04b97542c9a2e5d4c","body":"Hi guys\r\n\r\nIve been trying to use an Observale to replace the callbacks in my app, but for the life of me im not winning. Please can somebody tell me whats wrong here?\r\n\r\n```\r\nlogin(username: string, password: string): Observable<any> {\r\n console.log('Login called for user: ' + username);\r\n\r\n const authenticationData = {\r\n Username: username,\r\n Password: password,\r\n };\r\n const authenticationDetails = new AWSCognito.CognitoIdentityServiceProvider.AuthenticationDetails(authenticationData);\r\n\r\n const userData = {\r\n Username: username,\r\n Pool: new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(AuthService.POOL_CREDENTIALS)\r\n };\r\n\r\n const cognitoUser = new AWSCognito.CognitoIdentityServiceProvider.CognitoUser(userData);\r\n\r\n const awsObservable = Observable.bindCallback(cognitoUser.authenticateUser);\r\n\r\n return awsObservable.call(cognitoUser, authenticationDetails);\r\n }\r\n\r\n```\r\nI get an error message: r.newPasswordRequired is not a function.\r\n\r\nIm running a admin login so the first callback function called when logging in the is newPasswordRequired","issue_id":1660211071410,"origin_id":313143044,"user_origin_id":10204930,"create_time":1499269513,"update_time":1499269513,"id":1669237168401,"updated_at":"2022-11-23T20:59:28.400000Z","created_at":"2022-11-23T20:59:28.400000Z"},{"_id":"637e89b04b97542c9a2e5d4d","body":"@3uPh0riC I found the following while looking for how to tackle the observable challenge.\r\n```\r\n const userPool = new CognitoUserPool({\r\n UserPoolId: 'eu-west-1_ieIOsApl3',\r\n ClientId: '6krvmaga82j3kxhsydl02913kju'\r\n });\r\n\r\n const user = new CognitoUser({ Username: this.model.username, Pool: userPool });\r\n const authenticationData = { Username: this.model.username, Password: this.model.password };\r\n const authenticationDetails = new AuthenticationDetails(authenticationData);\r\n\r\n\r\n return Observable.create((observer: Observer<{ idToken: string }>) => {\r\n user.authenticateUser(authenticationDetails, {\r\n onSuccess: result => {\r\n observer.next({ idToken: '123131231313' });\r\n observer.complete();\r\n },\r\n onFailure: error => observer.error(error),\r\n newPasswordRequired: () => {}, \r\n mfaRequired: () => {}, \r\n customChallenge: () => {}\r\n });\r\n });\r\n```\r\n\r\nJust wondering if maybe for other methods I should also do return of `observer.complete();` and toggle some flags or just return error on all of them and handle that in subscriber ?\r\n\r\nAny ideas welcome :) \r\n\r\n","issue_id":1660211071410,"origin_id":326580116,"user_origin_id":9809655,"create_time":1504272541,"update_time":1504272541,"id":1669237168407,"updated_at":"2022-11-23T20:59:28.406000Z","created_at":"2022-11-23T20:59:28.406000Z"},{"_id":"637e89b04b97542c9a2e5d4e","body":"Hey any news from this. I would also like the code refactored with some observables but i think i could need some help on that. ","issue_id":1660211071410,"origin_id":362842260,"user_origin_id":17173951,"create_time":1517682133,"update_time":1517682133,"id":1669237168422,"updated_at":"2022-11-23T20:59:28.422000Z","created_at":"2022-11-23T20:59:28.422000Z"},{"_id":"637e89b04b97542c9a2e5d50","body":"I have found using custom observers as wrappers to assist in the control flow of sequential async calls a huge help in the short term especially in terms of handling race conditions that might exist in the application services logic as side effects.","issue_id":1660211071410,"origin_id":362845546,"user_origin_id":10137,"create_time":1517684797,"update_time":1517684797,"id":1669237168426,"updated_at":"2024-04-22T20:19:19.073000Z","created_at":"2022-11-23T20:59:28.426000Z"},{"_id":"637e89b04b97542c9a2e5d51","body":"I'm starting to look at https:\/\/github.com\/aws\/aws-amplify to refactor the code. If there are any volunteers, please feel free to submit a PR, otherwise please stay tuned. ","issue_id":1660211071410,"origin_id":362845853,"user_origin_id":2776052,"create_time":1517685038,"update_time":1517685038,"id":1669237168429,"updated_at":"2022-11-23T20:59:28.429000Z","created_at":"2022-11-23T20:59:28.429000Z"},{"_id":"637e89b04b97542c9a2e5d52","body":"In the near future the Angular-CLI will have functionality that outputs web\ncomponents that are able to be \"self-bootstrapped\" and may run anywhere on\nthe webpage even inside react. I believe this functionality is under the\nAngular Elements project and is still experimental. I would be interested\nin modularizing cognito functionality into web components adhering to the\n\"properties down and events up\" convention to achieve more concise auth api\nsimilar to that of the Firebase Auth API; however, the step above would be\nthe cognito logic already available packaged with a default set of web\ncomponents adhering to a predefined api that may support feature toggles\nthat represent various combinations of authflow scenarios. I am working on\nimplementing cognito in conjunction to @ngrx\/platform which is a state\nmanagement library for Angular that is comparable to redux with the\nexception that is adds support for RxJS as observable state functionality.\n\nOn Sat, Feb 3, 2018 at 11:10 AM, Vladimir Budilov <[email protected]>\nwrote:\n\n> I'm starting to look at https:\/\/github.com\/aws\/aws-amplify to refactor\n> the code. If there are any volunteers, please feel free to submit a PR,\n> otherwise please stay tuned.\n>\n> \u2014\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/awslabs\/aws-cognito-angular-quickstart\/issues\/24#issuecomment-362845853>,\n> or mute the thread\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/AcBgzlOhRbpqpEF9-GecciL5WaZGeoVaks5tRK8xgaJpZM4K73e5>\n> .\n>\n","issue_id":1660211071410,"origin_id":362847438,"user_origin_id":10137,"create_time":1517686256,"update_time":1517686256,"id":1669237168431,"updated_at":"2024-04-22T20:19:19.080000Z","created_at":"2022-11-23T20:59:28.431000Z"},{"_id":"637e89b04b97542c9a2e5d53","body":"@vbudilov Hi, just wonder how the progress for migrating to aws-amplify is. I am looking for an example with aws-amplify and can possibly help.\r\n\r\nOn the following readme, it says the example for Angular is coming soon?\r\nhttps:\/\/github.com\/aws\/aws-amplify\/blob\/master\/README.md#examples","issue_id":1660211071410,"origin_id":370951289,"user_origin_id":6880939,"create_time":1520375136,"update_time":1520375157,"id":1669237168435,"updated_at":"2022-11-23T20:59:28.434000Z","created_at":"2022-11-23T20:59:28.434000Z"},{"_id":"637e89b04b97542c9a2e5d54","body":"We just released a sample today that takes advantage of AWS Amplify, Cognito and Angular:\r\n\r\nhttps:\/\/github.com\/aws-samples\/aws-mobile-appsync-chat-starter-angular","issue_id":1660211071410,"origin_id":370952113,"user_origin_id":12226594,"create_time":1520375320,"update_time":1520375320,"id":1669237168438,"updated_at":"2022-11-23T20:59:28.437000Z","created_at":"2022-11-23T20:59:28.437000Z"},{"_id":"637e89b04b97542c9a2e5d55","body":"@awsed there is no github page for this example?","issue_id":1660211071410,"origin_id":370965023,"user_origin_id":6880939,"create_time":1520378473,"update_time":1520378473,"id":1669237168440,"updated_at":"2022-11-23T20:59:28.440000Z","created_at":"2022-11-23T20:59:28.440000Z"},{"_id":"637e89b04b97542c9a2e5d56","body":"This repo is public (see link on my previous comment) and there's also a related blog post: https:\/\/aws.amazon.com\/blogs\/mobile\/building-a-serverless-real-time-chat-application-with-aws-appsync\/","issue_id":1660211071410,"origin_id":370970435,"user_origin_id":12226594,"create_time":1520379945,"update_time":1520379945,"id":1669237168443,"updated_at":"2022-11-23T20:59:28.442000Z","created_at":"2022-11-23T20:59:28.442000Z"},{"_id":"637e89b04b97542c9a2e5d57","body":"@awsed I must have overlooked it. thanks. \r\nJust wonder if I am on the right direction. I am trying to use Amazon cognito(using federated identities) with my own signup and login UI, should I use [aws-amplify](https:\/\/aws.github.io\/aws-amplify\/media\/quick_start.html) or this [JavaScript SDK](https:\/\/docs.aws.amazon.com\/cognito\/latest\/developerguide\/using-amazon-cognito-user-identity-pools-javascript-examples.html) \r\n\r\nand since [amazon-cognito-identity-js](https:\/\/docs.aws.amazon.com\/cognito-user-identity-pools\/latest\/APIReference\/API_AdminLinkProviderForUser.html) has been integrated into aws-amplify. Is this document still valid if I use aws-amplify? \r\nFor example, I think I need this function [AdminLinkProviderForUser](https:\/\/docs.aws.amazon.com\/cognito-user-identity-pools\/latest\/APIReference\/API_AdminLinkProviderForUser.html) but it seems like it is in the JavaScript SDK?\r\n\r\nCould you please point me to the right SDK? thanks","issue_id":1660211071410,"origin_id":371219510,"user_origin_id":6880939,"create_time":1520444301,"update_time":1520445965,"id":1669237168446,"updated_at":"2022-11-23T20:59:28.445000Z","created_at":"2022-11-23T20:59:28.445000Z"},{"_id":"637e89b04b97542c9a2e5d58","body":"It seems that the aws-amplify Angular version is not yet released. If I have good results with Observables, I will do a PR. ","issue_id":1660211071410,"origin_id":383578780,"user_origin_id":10137,"create_time":1524490803,"update_time":1524490803,"id":1669237168449,"updated_at":"2022-11-23T20:59:28.448000Z","created_at":"2022-11-23T20:59:28.448000Z"},{"_id":"637e89b04b97542c9a2e5d59","body":"@rudyhadoux it actually has been released: https:\/\/github.com\/aws\/aws-amplify\/pull\/662\r\n","issue_id":1660211071410,"origin_id":383584347,"user_origin_id":2776052,"create_time":1524491804,"update_time":1524491804,"id":1669237168451,"updated_at":"2022-11-23T20:59:28.451000Z","created_at":"2022-11-23T20:59:28.451000Z"},{"_id":"637e89b04b97542c9a2e5d5a","body":"Thanks for the link. So, is this quickstart still useful ?","issue_id":1660211071410,"origin_id":383593526,"user_origin_id":10137,"create_time":1524493417,"update_time":1524493417,"id":1669237168453,"updated_at":"2022-11-23T20:59:28.453000Z","created_at":"2022-11-23T20:59:28.453000Z"},{"_id":"637e89b04b97542c9a2e5d5b","body":"It is. I need to find the time to substitute the current implementation\nwith the aws-amplify one. Feel free to submit a PR if you are able to\ncreate this functionality.\n\nOn Mon, Apr 23, 2018 at 10:23 AM, rudyhadoux <[email protected]>\nwrote:\n\n> Thanks for the link. So, is this quickstart still useful ?\n>\n> \u2014\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/awslabs\/aws-cognito-angular-quickstart\/issues\/24#issuecomment-383593526>,\n> or mute the thread\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/ACpb9H3YRCQf3lz-XdDsrVs8qBPaC4zGks5trePqgaJpZM4K73e5>\n> .\n>\n","issue_id":1660211071410,"origin_id":383599824,"user_origin_id":2776052,"create_time":1524494481,"update_time":1524494481,"id":1669237168458,"updated_at":"2022-11-23T20:59:28.457000Z","created_at":"2022-11-23T20:59:28.457000Z"},{"_id":"637e89b04b97542c9a2e5d5c","body":"I think this quickstart would still be 100 % useful with only aws-amplify-angular methods and a full serverless CRUD (Lambdas + DynamoDB (federated identities authorized) objects).","issue_id":1660211071410,"origin_id":383600477,"user_origin_id":10137,"create_time":1524494592,"update_time":1524494592,"id":1669237168460,"updated_at":"2022-11-23T20:59:28.459000Z","created_at":"2022-11-23T20:59:28.459000Z"},{"_id":"637e89b04b97542c9a2e5d5d","body":"@vbudilov My comment was not a reproach but now with Amplify it is easy to implement AWS Cognito within an Angular 5+ App.","issue_id":1660211071410,"origin_id":383649732,"user_origin_id":10137,"create_time":1524503197,"update_time":1524503197,"id":1669237168463,"updated_at":"2022-11-23T20:59:28.462000Z","created_at":"2022-11-23T20:59:28.462000Z"}] comment

You create a lot of tight coupling and testability woes by using callbacks. A more angular way would be to use Observables, probably based on Behavioral Subjects. You might also...

enhancement

A number of source files in this project are missing trailing newlines. It's obviously not a BIG deal, but failing to include trailing newlines can break all kinds of command-line...

Cannot read property 'ddb' of undefined

[{"_id":"637e9afb5ae95c7a222dcf24","body":"More information, the issue occurs when:\r\n-Login in the app\r\n-Close the tap\r\n-Open the app and it appears in the console.","issue_id":1660211071418,"origin_id":381443683,"user_origin_id":38407321,"create_time":1523831887,"update_time":1523831887,"id":1669241595505,"updated_at":"2022-11-23T22:13:15.505000Z","created_at":"2022-11-23T22:13:15.505000Z"}] comment

Hi, it is a good example of how to use aws cognito to users manage, I am beginning in the programming world and I am learning. I have tested the...

LocalStack does not support cognito-idp or cognito-identity, so the quickstart app can't run on LocalStack. Suppported services are documented at https://github.com/localstack/localstack

Unable to get temporary credentials

[{"_id":"637e8961bc25e83db0083ba9","body":"`AWS.config.credentials` is a magic wrapper over credentials, and its asynchronous operation to get temporary keys.\r\nTry `.get()` or `.refresh()` methods on credentials object.\r\nYou can create promise:\r\n\r\n```let getCredentials = new Promise<AWS.CognitoIdentityCredentials>((resolve, rejection) => {\r\n AWS.config.credentials.get((err) => {\r\n if (err) {\r\n rejection(err)\r\n } else {\r\n resolve(AWS.config.credentials)\r\n }\r\n })\r\n })\r\n```\r\nand then use it `getCredentials.then(creds=> doSomething(creds))`","issue_id":1660211071426,"origin_id":377244882,"user_origin_id":3659502,"create_time":1522332113,"update_time":1522332256,"id":1669237089681,"updated_at":"2022-11-23T20:58:09.680000Z","created_at":"2022-11-23T20:58:09.680000Z"}] comment

Hi, I implemented your code in my angular project. I am able to fetch tokenID from AWS Cognito after verification but when I see credentials, it shows accessKeyId:undefined data:null expireTime:null...

How would you be able to maintain a valid token if a user were to have dashboard with 20 components loading on the page? Considering each component now does a...

### awslabs/aws-cognito-angular-quickstart now has a Chat Room on Gitter @vbudilov has just created a chat room. You can visit it here: [https://gitter.im/awslabs/aws-cognito-angular-quickstart](https://gitter.im/awslabs/aws-cognito-angular-quickstart?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&content=body_link). This pull-request adds this badge to your README.md:...

what needs to change for federating using SAML? I don't see the login using corporate ID