@alfresco/adf-core 9.1.0-16417501443 → 9.1.0-16418062135
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/fesm2022/adf-core.mjs +45 -34
- package/fesm2022/adf-core.mjs.map +1 -1
- package/lib/auth/basic-auth/basic-alfresco-auth.service.d.ts +13 -0
- package/lib/auth/interfaces/authentication-service.interface.d.ts +9 -4
- package/lib/auth/oidc/oidc-authentication.service.d.ts +15 -5
- package/lib/auth/services/authentication.service.d.ts +12 -2
- package/lib/auth/services/base-authentication.service.d.ts +5 -1
- package/package.json +3 -3
package/fesm2022/adf-core.mjs
CHANGED
|
@@ -7344,10 +7344,6 @@ class BaseAuthenticationService {
|
|
|
7344
7344
|
const provider = this.appConfig.get('providers');
|
|
7345
7345
|
return provider && provider.toUpperCase() === 'ALL';
|
|
7346
7346
|
}
|
|
7347
|
-
isOauthConfiguration() {
|
|
7348
|
-
const authType = this.appConfig.get('authType');
|
|
7349
|
-
return authType === 'OAUTH';
|
|
7350
|
-
}
|
|
7351
7347
|
/**
|
|
7352
7348
|
* Prints an error message in the console browser
|
|
7353
7349
|
*
|
|
@@ -7741,12 +7737,20 @@ class OidcAuthenticationService extends BaseAuthenticationService {
|
|
|
7741
7737
|
*/
|
|
7742
7738
|
this.shouldPerformSsoLogin$ = combineLatest([this.auth.authenticated$, this.auth.isDiscoveryDocumentLoaded$]).pipe(map(([authenticated, isDiscoveryDocumentLoaded]) => !authenticated && isDiscoveryDocumentLoaded));
|
|
7743
7739
|
}
|
|
7740
|
+
/**
|
|
7741
|
+
* @deprecated use `isLoggedIn` instead
|
|
7742
|
+
* @returns true if the ECM provider is logged in
|
|
7743
|
+
*/
|
|
7744
7744
|
isEcmLoggedIn() {
|
|
7745
7745
|
if (this.isECMProvider() || this.isALLProvider()) {
|
|
7746
7746
|
return this.isLoggedIn();
|
|
7747
7747
|
}
|
|
7748
7748
|
return false;
|
|
7749
7749
|
}
|
|
7750
|
+
/**
|
|
7751
|
+
* @deprecated use `isLoggedIn` instead
|
|
7752
|
+
* @returns true if the BPM provider is logged in
|
|
7753
|
+
*/
|
|
7750
7754
|
isBpmLoggedIn() {
|
|
7751
7755
|
if (this.isBPMProvider() || this.isALLProvider()) {
|
|
7752
7756
|
return this.isLoggedIn();
|
|
@@ -7762,14 +7766,6 @@ class OidcAuthenticationService extends BaseAuthenticationService {
|
|
|
7762
7766
|
hasValidIdToken() {
|
|
7763
7767
|
return this.oauthService.hasValidIdToken();
|
|
7764
7768
|
}
|
|
7765
|
-
isImplicitFlow() {
|
|
7766
|
-
const oauth2 = Object.assign({}, this.appConfig.get(AppConfigValues.OAUTHCONFIG, null));
|
|
7767
|
-
return !!oauth2?.implicitFlow;
|
|
7768
|
-
}
|
|
7769
|
-
isAuthCodeFlow() {
|
|
7770
|
-
const oauth2 = Object.assign({}, this.appConfig.get(AppConfigValues.OAUTHCONFIG, null));
|
|
7771
|
-
return !!oauth2?.codeFlow;
|
|
7772
|
-
}
|
|
7773
7769
|
login(username, password) {
|
|
7774
7770
|
return this.auth.baseAuthLogin(username, password).pipe(map((response) => {
|
|
7775
7771
|
this.onLogin.next(response);
|
|
@@ -7798,18 +7794,23 @@ class OidcAuthenticationService extends BaseAuthenticationService {
|
|
|
7798
7794
|
}
|
|
7799
7795
|
});
|
|
7800
7796
|
}
|
|
7797
|
+
/**
|
|
7798
|
+
* Gets the username of the authenticated user.
|
|
7799
|
+
*
|
|
7800
|
+
* @returns the logged username
|
|
7801
|
+
*/
|
|
7801
7802
|
getUsername() {
|
|
7802
7803
|
return this.jwtHelperService.getValueFromLocalToken(JwtHelperService.USER_PREFERRED_USERNAME);
|
|
7803
7804
|
}
|
|
7804
7805
|
/**
|
|
7805
|
-
* @deprecated
|
|
7806
|
+
* @deprecated use `getUsername` instead
|
|
7806
7807
|
* @returns the logged username
|
|
7807
7808
|
*/
|
|
7808
7809
|
getEcmUsername() {
|
|
7809
7810
|
return this.getUsername();
|
|
7810
7811
|
}
|
|
7811
7812
|
/**
|
|
7812
|
-
* @deprecated
|
|
7813
|
+
* @deprecated use `getUsername` instead
|
|
7813
7814
|
* @returns the logged username
|
|
7814
7815
|
*/
|
|
7815
7816
|
getBpmUsername() {
|
|
@@ -7818,9 +7819,6 @@ class OidcAuthenticationService extends BaseAuthenticationService {
|
|
|
7818
7819
|
ssoLogin(redirectUrl) {
|
|
7819
7820
|
this.auth.login(redirectUrl);
|
|
7820
7821
|
}
|
|
7821
|
-
ssoCodeFlowLogin() {
|
|
7822
|
-
this.oauthService.initCodeFlow();
|
|
7823
|
-
}
|
|
7824
7822
|
isRememberMeSet() {
|
|
7825
7823
|
return true;
|
|
7826
7824
|
}
|
|
@@ -8521,12 +8519,25 @@ class BasicAlfrescoAuthService extends BaseAuthenticationService {
|
|
|
8521
8519
|
hasSelectedProviderAll(provider) {
|
|
8522
8520
|
return this.redirectUrl && (this.redirectUrl.provider === 'ALL' || provider === 'ALL');
|
|
8523
8521
|
}
|
|
8522
|
+
/**
|
|
8523
|
+
* @deprecated use `getUsername()` instead
|
|
8524
|
+
* @returns the username of the authenticated user
|
|
8525
|
+
*/
|
|
8524
8526
|
getBpmUsername() {
|
|
8525
8527
|
return this.processAuth.getUsername();
|
|
8526
8528
|
}
|
|
8529
|
+
/**
|
|
8530
|
+
* @deprecated use `getUsername()` instead
|
|
8531
|
+
* @returns the username of the authenticated user
|
|
8532
|
+
*/
|
|
8527
8533
|
getEcmUsername() {
|
|
8528
8534
|
return this.contentAuth.getUsername();
|
|
8529
8535
|
}
|
|
8536
|
+
/**
|
|
8537
|
+
* Gets the username of the authenticated user.
|
|
8538
|
+
*
|
|
8539
|
+
* @returns the username of the authenticated user
|
|
8540
|
+
*/
|
|
8530
8541
|
getUsername() {
|
|
8531
8542
|
if (this.isBPMProvider()) {
|
|
8532
8543
|
return this.processAuth.getUsername();
|
|
@@ -9086,17 +9097,25 @@ class AuthenticationService {
|
|
|
9086
9097
|
return from(this.basicAlfrescoAuthService.logout());
|
|
9087
9098
|
}
|
|
9088
9099
|
}
|
|
9100
|
+
/**
|
|
9101
|
+
* @deprecated use `isLoggedIn` instead
|
|
9102
|
+
* @returns true if the ECM provider is logged in
|
|
9103
|
+
*/
|
|
9089
9104
|
isEcmLoggedIn() {
|
|
9090
9105
|
if (this.isOauth()) {
|
|
9091
|
-
return this.oidcAuthenticationService.
|
|
9106
|
+
return this.oidcAuthenticationService.isLoggedIn();
|
|
9092
9107
|
}
|
|
9093
9108
|
else {
|
|
9094
9109
|
return this.basicAlfrescoAuthService.isEcmLoggedIn();
|
|
9095
9110
|
}
|
|
9096
9111
|
}
|
|
9112
|
+
/**
|
|
9113
|
+
* @deprecated use `isLoggedIn` instead
|
|
9114
|
+
* @returns true if the BPM provider is logged in
|
|
9115
|
+
*/
|
|
9097
9116
|
isBpmLoggedIn() {
|
|
9098
9117
|
if (this.isOauth()) {
|
|
9099
|
-
return this.oidcAuthenticationService.
|
|
9118
|
+
return this.oidcAuthenticationService.isLoggedIn();
|
|
9100
9119
|
}
|
|
9101
9120
|
else {
|
|
9102
9121
|
return this.basicAlfrescoAuthService.isBpmLoggedIn();
|
|
@@ -9119,6 +9138,8 @@ class AuthenticationService {
|
|
|
9119
9138
|
}
|
|
9120
9139
|
}
|
|
9121
9140
|
/**
|
|
9141
|
+
* Gets the username of the authenticated user.
|
|
9142
|
+
*
|
|
9122
9143
|
* @returns the username of the authenticated user
|
|
9123
9144
|
*/
|
|
9124
9145
|
getUsername() {
|
|
@@ -9130,28 +9151,18 @@ class AuthenticationService {
|
|
|
9130
9151
|
}
|
|
9131
9152
|
}
|
|
9132
9153
|
/**
|
|
9133
|
-
* @deprecated
|
|
9154
|
+
* @deprecated use `getUsername` instead
|
|
9134
9155
|
* @returns the logged username
|
|
9135
9156
|
*/
|
|
9136
9157
|
getEcmUsername() {
|
|
9137
|
-
|
|
9138
|
-
return this.oidcAuthenticationService.getUsername();
|
|
9139
|
-
}
|
|
9140
|
-
else {
|
|
9141
|
-
return this.basicAlfrescoAuthService.getEcmUsername();
|
|
9142
|
-
}
|
|
9158
|
+
return this.getUsername();
|
|
9143
9159
|
}
|
|
9144
9160
|
/**
|
|
9145
|
-
* @deprecated
|
|
9161
|
+
* @deprecated use `getUsername` instead
|
|
9146
9162
|
* @returns the logged username
|
|
9147
9163
|
*/
|
|
9148
9164
|
getBpmUsername() {
|
|
9149
|
-
|
|
9150
|
-
return this.oidcAuthenticationService.getUsername();
|
|
9151
|
-
}
|
|
9152
|
-
else {
|
|
9153
|
-
return this.basicAlfrescoAuthService.getBpmUsername();
|
|
9154
|
-
}
|
|
9165
|
+
return this.getUsername();
|
|
9155
9166
|
}
|
|
9156
9167
|
getAuthHeaders(requestUrl, headers) {
|
|
9157
9168
|
if (this.isOauth()) {
|
|
@@ -9433,7 +9444,7 @@ const AuthGuardBpm = async (_, state) => {
|
|
|
9433
9444
|
if (authenticationService.isLoggedIn() && authenticationService.isOauth() && authGuardBaseService.isLoginFragmentPresent()) {
|
|
9434
9445
|
return authGuardBaseService.redirectSSOSuccessURL();
|
|
9435
9446
|
}
|
|
9436
|
-
if (authenticationService.
|
|
9447
|
+
if (authenticationService.isLoggedIn() || authGuardBaseService.withCredentials) {
|
|
9437
9448
|
return true;
|
|
9438
9449
|
}
|
|
9439
9450
|
return authGuardBaseService.redirectToUrl(state.url);
|