@annalib/anna-cognito-lib 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/anna-cognito-lib.module.mjs +7 -2
- package/esm2020/lib/components/duo-sso-login/duo-sso-login.component.mjs +36 -0
- package/esm2020/lib/components/forgot-password/forgot-password.component.mjs +2 -2
- package/esm2020/lib/components/login/login.component.mjs +7 -4
- package/esm2020/lib/components/set-new-password/set-new-password.component.mjs +4 -4
- package/esm2020/lib/components/verify-and-set-new-password/verify-and-set-new-password.component.mjs +2 -2
- package/esm2020/lib/config/auth-service.token.mjs +1 -1
- package/esm2020/lib/services/auth.service.mjs +177 -182
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/annalib-anna-cognito-lib.mjs +242 -191
- package/fesm2015/annalib-anna-cognito-lib.mjs.map +1 -1
- package/fesm2020/annalib-anna-cognito-lib.mjs +247 -219
- package/fesm2020/annalib-anna-cognito-lib.mjs.map +1 -1
- package/lib/anna-cognito-lib.module.d.ts +5 -4
- package/lib/components/duo-sso-login/duo-sso-login.component.d.ts +15 -0
- package/lib/components/login/login.component.d.ts +1 -0
- package/lib/config/auth-service.token.d.ts +2 -0
- package/lib/services/auth.service.d.ts +17 -27
- package/package.json +3 -2
- package/public-api.d.ts +1 -0
|
@@ -8,12 +8,13 @@ import * as i6 from "./directives/spinner-button/spinner-button.directive";
|
|
|
8
8
|
import * as i7 from "./components/version-and-term-policy/version-and-term-policy.component";
|
|
9
9
|
import * as i8 from "./components/surewaves-year-logo/surewaves-year-logo.component";
|
|
10
10
|
import * as i9 from "./components/powered-by-logo-template/powered-by-logo-template.component";
|
|
11
|
-
import * as i10 from "
|
|
12
|
-
import * as i11 from "@angular/
|
|
13
|
-
import * as i12 from "@angular/
|
|
11
|
+
import * as i10 from "./components/duo-sso-login/duo-sso-login.component";
|
|
12
|
+
import * as i11 from "@angular/forms";
|
|
13
|
+
import * as i12 from "@angular/router";
|
|
14
|
+
import * as i13 from "@angular/common";
|
|
14
15
|
export declare class AnnaCognitoLibModule {
|
|
15
16
|
constructor();
|
|
16
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<AnnaCognitoLibModule, never>;
|
|
17
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AnnaCognitoLibModule, [typeof i1.LoginComponent, typeof i2.SetNewPasswordComponent, typeof i3.PasswordMatchingComponent, typeof i4.ForgotPasswordComponent, typeof i5.VerifyAndSetNewPasswordComponent, typeof i6.SpinnerButtonDirective, typeof i7.VersionAndTermPolicyComponent, typeof i8.SurewavesYearLogoComponent, typeof i9.PoweredByLogoTemplateComponent], [typeof
|
|
18
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AnnaCognitoLibModule, [typeof i1.LoginComponent, typeof i2.SetNewPasswordComponent, typeof i3.PasswordMatchingComponent, typeof i4.ForgotPasswordComponent, typeof i5.VerifyAndSetNewPasswordComponent, typeof i6.SpinnerButtonDirective, typeof i7.VersionAndTermPolicyComponent, typeof i8.SurewavesYearLogoComponent, typeof i9.PoweredByLogoTemplateComponent, typeof i10.DuoSsoLoginComponent], [typeof i11.FormsModule, typeof i11.ReactiveFormsModule, typeof i12.RouterModule, typeof i13.CommonModule, typeof i13.NgOptimizedImage], [typeof i1.LoginComponent, typeof i10.DuoSsoLoginComponent, typeof i2.SetNewPasswordComponent, typeof i3.PasswordMatchingComponent, typeof i4.ForgotPasswordComponent, typeof i5.VerifyAndSetNewPasswordComponent, typeof i6.SpinnerButtonDirective, typeof i7.VersionAndTermPolicyComponent, typeof i8.SurewavesYearLogoComponent, typeof i9.PoweredByLogoTemplateComponent, typeof i13.NgOptimizedImage]>;
|
|
18
19
|
static ɵinj: i0.ɵɵInjectorDeclaration<AnnaCognitoLibModule>;
|
|
19
20
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IConfigService } from '../../config/config-service.token';
|
|
2
|
+
import { LoginConstant } from '../../constants/loginConstant';
|
|
3
|
+
import { AnnaLibAuthService } from '../../services/auth.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DuoSsoLoginComponent {
|
|
6
|
+
authService: AnnaLibAuthService;
|
|
7
|
+
consumingProjectConfigService: IConfigService;
|
|
8
|
+
constants: typeof LoginConstant;
|
|
9
|
+
constructor(authService: AnnaLibAuthService, consumingProjectConfigService: IConfigService);
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
signInWithSSO(): void;
|
|
12
|
+
signInWithCognito(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DuoSsoLoginComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DuoSsoLoginComponent, "anna-cognito-lib-duo-sso-login", never, {}, {}, never, never, false, never>;
|
|
15
|
+
}
|
|
@@ -14,6 +14,7 @@ export declare class LoginComponent implements OnInit {
|
|
|
14
14
|
ngOnInit(): void;
|
|
15
15
|
onIntialiseForm(): void;
|
|
16
16
|
OnLogin(): void;
|
|
17
|
+
signInWithSSO(): void;
|
|
17
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<LoginComponent, never>;
|
|
18
19
|
static ɵcmp: i0.ɵɵComponentDeclaration<LoginComponent, "anna-cognito-lib-login", never, {}, {}, never, never, false, never>;
|
|
19
20
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { HttpClient } from "@angular/common/http";
|
|
2
2
|
import { Router } from "@angular/router";
|
|
3
|
-
import {
|
|
3
|
+
import { AuthTokens, SignInInput } from "aws-amplify/auth";
|
|
4
4
|
import { ToastrService } from 'ngx-toastr';
|
|
5
5
|
import { IAuthService } from '../config/auth-service.token';
|
|
6
6
|
import { IConfigService } from '../config/config-service.token';
|
|
7
|
-
import { UserPoolInformation } from "../models/auth.model";
|
|
8
7
|
import { AnnaLibAclService } from './acl.service';
|
|
9
8
|
import * as i0 from "@angular/core";
|
|
10
9
|
export declare class AnnaLibAuthService {
|
|
@@ -14,13 +13,8 @@ export declare class AnnaLibAuthService {
|
|
|
14
13
|
private toastr;
|
|
15
14
|
consumingProjectAuthService: IAuthService;
|
|
16
15
|
consumingProjectConfigService: IConfigService;
|
|
17
|
-
poolData: UserPoolInformation;
|
|
18
|
-
userPool: CognitoUserPool;
|
|
19
|
-
cognitoUser: CognitoUser;
|
|
20
|
-
authenticationDetails: AuthenticationDetails;
|
|
21
|
-
tokenValid: boolean;
|
|
22
16
|
accessToken: string;
|
|
23
|
-
|
|
17
|
+
IdToken: any;
|
|
24
18
|
loginErrorMessage: string | null;
|
|
25
19
|
setNewPasswordErrorMessage: string;
|
|
26
20
|
setNewPasswordButtonMessage: string;
|
|
@@ -31,32 +25,28 @@ export declare class AnnaLibAuthService {
|
|
|
31
25
|
sessionLocked: boolean;
|
|
32
26
|
userName: any;
|
|
33
27
|
accessTokenTimerId: any;
|
|
34
|
-
IdToken: any;
|
|
35
28
|
forgotPasswordAndGlobalSignoutLoader: boolean;
|
|
29
|
+
userPassword: any;
|
|
36
30
|
constructor(router: Router, aclService: AnnaLibAclService, httpClient: HttpClient, toastr: ToastrService, consumingProjectAuthService: IAuthService, consumingProjectConfigService: IConfigService);
|
|
37
31
|
ngOnInit(): void;
|
|
38
|
-
/***
|
|
39
|
-
1. takes user pool data (userPool ID and client ID)
|
|
40
|
-
2. if current user is null then it means user already logged out then simply return Promise<false>
|
|
41
|
-
3. if current user present check if token is valid for it.
|
|
42
|
-
*/
|
|
43
32
|
isUserLoggedIn(): Promise<boolean>;
|
|
44
33
|
sessionTimeout(): void;
|
|
45
|
-
refreshAccessToken(): void;
|
|
46
34
|
computeTokenExpiration(token: any): number;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
onForgotPasswordGenerateOTP(email: string): void
|
|
53
|
-
verifyCode(
|
|
35
|
+
getCurrentSession(): Promise<any>;
|
|
36
|
+
handleSignIn({ username, password }: SignInInput): Promise<void>;
|
|
37
|
+
getAllCognitoTokenAndGroups(token: AuthTokens): Promise<void>;
|
|
38
|
+
refreshAccessToken(): void;
|
|
39
|
+
changePassword(newPassword: string): Promise<void>;
|
|
40
|
+
onForgotPasswordGenerateOTP(email: string): Promise<void>;
|
|
41
|
+
verifyCode(confirmationCode: string, newPassword: string): Promise<void>;
|
|
54
42
|
forgotPasswordError(err: any, noOfAttempts: number): string;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
43
|
+
signInWithDuo(): void;
|
|
44
|
+
signInWithCognito(): void;
|
|
45
|
+
handleSignOut(): Promise<void>;
|
|
46
|
+
expiryAllExistingCurrentSession(username: string, newPassword: string): void;
|
|
47
|
+
setUserDetails(): void;
|
|
48
|
+
onLoginInCogntioToGetAccessToken(username: string, password: string): Promise<void>;
|
|
49
|
+
onCallGlobalSignout(): Promise<void>;
|
|
60
50
|
static ɵfac: i0.ɵɵFactoryDeclaration<AnnaLibAuthService, never>;
|
|
61
51
|
static ɵprov: i0.ɵɵInjectableDeclaration<AnnaLibAuthService>;
|
|
62
52
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@annalib/anna-cognito-lib",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^15.2.9",
|
|
6
6
|
"@angular/core": "^15.2.9",
|
|
7
7
|
"@mdi/font": "^5.9.55",
|
|
8
8
|
"@ng-bootstrap/ng-bootstrap": "^14.1.1",
|
|
9
9
|
"@types/node": "^12.11.1",
|
|
10
|
-
"
|
|
10
|
+
"@aws-amplify/ui-angular": "^5.0.2",
|
|
11
|
+
"aws-amplify": "^6.0.4",
|
|
11
12
|
"bootstrap": "^5.2.3",
|
|
12
13
|
"ngx-toastr": "^15.2.2"
|
|
13
14
|
},
|
package/public-api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './lib/anna-cognito-lib.module';
|
|
2
2
|
export * from './lib/components/login/login.component';
|
|
3
|
+
export * from './lib/components/duo-sso-login/duo-sso-login.component';
|
|
3
4
|
export * from './lib/components/forgot-password/forgot-password.component';
|
|
4
5
|
export * from './lib/components/set-new-password/set-new-password.component';
|
|
5
6
|
export * from './lib/components/password-matching/password-matching.component';
|