https://github.com/goldenbearkin/angular-cognito-demo
Showcase of Angular authentication flow with Amazon Cognito
https://github.com/goldenbearkin/angular-cognito-demo
angular angular-cli angular-material aws-cognito typescript
Last synced: 2 months ago
JSON representation
Showcase of Angular authentication flow with Amazon Cognito
- Host: GitHub
- URL: https://github.com/goldenbearkin/angular-cognito-demo
- Owner: goldenbearkin
- Created: 2017-02-13T12:37:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-13T12:43:00.000Z (over 8 years ago)
- Last Synced: 2025-04-26T17:46:58.916Z (6 months ago)
- Topics: angular, angular-cli, angular-material, aws-cognito, typescript
- Language: TypeScript
- Size: 99.6 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Angular Cognito Demo
An showcase of Angular web app utilizing Amazon Cognito.## Todos (priority order)
* intergrate with Apollo client
* migrate to ngrx v3 (not yet released)
* write unit tests for widget components## Known issues
1. The callback type of cognitoUser.authenticateUser hasn't marked the newPasswordRequired, mfaRequired, customChallenge
as optional. Now just declare as no-op. Need to remove after #238 get fixed.
``` typescript
export class UserLoginService {constructor(private cognitoUtilityService: CognitoUtilityService) { }
private _authCognito$(alias: string, password: string): Observable<{ idToken: string }> {
...return Observable.create((observer: Observer<{ idToken: string }>) => {
cognitoUser.authenticateUser(authenticationDetails, {
onSuccess: session => {
observer.next({ idToken: session.getIdToken().getJwtToken() });
observer.complete();
},
onFailure: error => observer.error(error),
newPasswordRequired: () => {}, // no-op
mfaRequired: () => {}, // no-op
customChallenge: () => {} // no-op
});
});
}
```