mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
Fix cancary serve
This commit is contained in:
@@ -251,6 +251,9 @@
|
|||||||
},
|
},
|
||||||
"e2e": {
|
"e2e": {
|
||||||
"browserTarget": "demoshell:build:e2e"
|
"browserTarget": "demoshell:build:e2e"
|
||||||
|
},
|
||||||
|
"canary": {
|
||||||
|
"browserTarget": "demoshell:build:canary"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
"issuer": "{protocol}//{hostname}{:port}/auth/realms/alfresco",
|
"issuer": "{protocol}//{hostname}{:port}/auth/realms/alfresco",
|
||||||
"loginUrl": "{protocol}//{hostname}{:port}/auth/realms/alfresco/protocol/openid-connect/auth",
|
"loginUrl": "{protocol}//{hostname}{:port}/auth/realms/alfresco/protocol/openid-connect/auth",
|
||||||
"silentRefreshRedirectUri": "{protocol}//{hostname}{:port}/assets/silent-refresh.html",
|
"silentRefreshRedirectUri": "{protocol}//{hostname}{:port}/assets/silent-refresh.html",
|
||||||
"redirectUri": "/",
|
"redirectUri": "{protocol}//{hostname}{:port}/",
|
||||||
"postLogoutRedirectUri": "#/logout",
|
"postLogoutRedirectUri": "{protocol}//{hostname}{:port}/#/logout",
|
||||||
"clientId": "alfresco",
|
"clientId": "alfresco",
|
||||||
"scope": "openid profile email",
|
"scope": "openid profile email",
|
||||||
"responseType": "code"
|
"responseType": "code"
|
||||||
|
@@ -135,12 +135,17 @@ registerLocaleData(localeFi);
|
|||||||
registerLocaleData(localeDa);
|
registerLocaleData(localeDa);
|
||||||
registerLocaleData(localeSv);
|
registerLocaleData(localeSv);
|
||||||
|
|
||||||
debugger;
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
|
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
FormsModule,
|
||||||
|
HttpClientModule,
|
||||||
|
MaterialModule,
|
||||||
|
FlexLayoutModule,
|
||||||
|
TranslateModule.forRoot(),
|
||||||
|
|
||||||
...(environment.oidc ?
|
...(environment.oidc ?
|
||||||
[
|
[
|
||||||
// Initial navigation must be disabled when we use the OIDC package with HashLocationStrategy, check its documentation
|
// Initial navigation must be disabled when we use the OIDC package with HashLocationStrategy, check its documentation
|
||||||
@@ -165,12 +170,7 @@ debugger;
|
|||||||
CoreModule.forRoot({ authByJsApi: true })
|
CoreModule.forRoot({ authByJsApi: true })
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
ReactiveFormsModule,
|
|
||||||
FormsModule,
|
|
||||||
HttpClientModule,
|
|
||||||
MaterialModule,
|
|
||||||
FlexLayoutModule,
|
|
||||||
TranslateModule.forRoot(),
|
|
||||||
ContentModule.forRoot(),
|
ContentModule.forRoot(),
|
||||||
InsightsModule.forRoot(),
|
InsightsModule.forRoot(),
|
||||||
ProcessModule.forRoot(),
|
ProcessModule.forRoot(),
|
||||||
|
@@ -35,7 +35,8 @@ import { AuthConfigService, configureAuth } from './services/auth-config.service
|
|||||||
{
|
{
|
||||||
provide: APP_INITIALIZER,
|
provide: APP_INITIALIZER,
|
||||||
useFactory: configureAuth,
|
useFactory: configureAuth,
|
||||||
deps: [ AuthConfigService ]
|
deps: [ AuthConfigService ],
|
||||||
|
multi: true
|
||||||
},
|
},
|
||||||
// TODO: CANARY: This is temporary, we are reproviding ADF's AuthenticationService with our own implementation to work with the new auth library
|
// TODO: CANARY: This is temporary, we are reproviding ADF's AuthenticationService with our own implementation to work with the new auth library
|
||||||
// TODO: But we need definitely need a cleaner solution for this. Which means, first we need to make the apis capable of handling multiple http clients
|
// TODO: But we need definitely need a cleaner solution for this. Which means, first we need to make the apis capable of handling multiple http clients
|
||||||
|
@@ -23,7 +23,7 @@ import { Router } from '@angular/router';
|
|||||||
import { StorageService } from '@alfresco/adf-core/common';
|
import { StorageService } from '@alfresco/adf-core/common';
|
||||||
import { AppConfigService, AppConfigValues } from '@alfresco/adf-core/config';
|
import { AppConfigService, AppConfigValues } from '@alfresco/adf-core/config';
|
||||||
|
|
||||||
export const configureAuth = (oidcAuthentication: AuthConfigService) => () => oidcAuthentication.init();
|
export const configureAuth = (oidcAuthentication: AuthConfigService) => () => oidcAuthentication.load();
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AuthConfigService {
|
export class AuthConfigService {
|
||||||
@@ -37,8 +37,7 @@ export class AuthConfigService {
|
|||||||
private router: Router
|
private router: Router
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public init() {
|
public load() {
|
||||||
debugger;
|
|
||||||
this.appConfigService.onLoad
|
this.appConfigService.onLoad
|
||||||
.pipe(take(1))
|
.pipe(take(1))
|
||||||
.toPromise()
|
.toPromise()
|
||||||
@@ -64,18 +63,4 @@ export class AuthConfigService {
|
|||||||
isCodeFlow(): boolean {
|
isCodeFlow(): boolean {
|
||||||
return this._authConfig.responseType === 'code';
|
return this._authConfig.responseType === 'code';
|
||||||
}
|
}
|
||||||
|
|
||||||
// private getAuthConfig(codeFlow = false): AuthConfig {
|
|
||||||
// const oauth2: OauthConfigModel = Object.assign({});
|
|
||||||
// return {
|
|
||||||
// issuer: oauth2.host,
|
|
||||||
// loginUrl: `${oauth2.host}/protocol/openid-connect/auth`,
|
|
||||||
// silentRefreshRedirectUri: oauth2.redirectSilentIframeUri,
|
|
||||||
// redirectUri: window.location.origin + oauth2.redirectUri,
|
|
||||||
// postLogoutRedirectUri: window.location.origin + oauth2.redirectUriLogout,
|
|
||||||
// clientId: oauth2.clientId,
|
|
||||||
// scope: oauth2.scope,
|
|
||||||
// ...(codeFlow ? { responseType: 'code' } : {})
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
@@ -116,9 +116,9 @@ export class AppConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeof result === 'object') {
|
if (typeof result === 'object') {
|
||||||
result = JSON.parse(JSON.stringify(result).replace('{hostname}', this.getLocationHostname()));
|
result = JSON.parse(JSON.stringify(result).replace(/\{hostname\}/g, this.getLocationHostname()));
|
||||||
result = JSON.parse(JSON.stringify(result).replace('{:port}', this.getLocationPort(':')));
|
result = JSON.parse(JSON.stringify(result).replace(/\{\:port\}/g, this.getLocationPort(':')));
|
||||||
result = JSON.parse(JSON.stringify(result).replace('{protocol}', this.getLocationProtocol()));
|
result = JSON.parse(JSON.stringify(result).replace(/\{protocol\}/g, this.getLocationProtocol()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result === undefined) {
|
if (result === undefined) {
|
||||||
|
@@ -29,7 +29,7 @@ export class DebugAppConfigService extends AppConfigService {
|
|||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
get<T>(key: string, defaultValue?: T): T {
|
get<T>(key: string, defaultValue?: T): T {
|
||||||
if (key === AppConfigValues.OAUTHCONFIG) {
|
if (key === AppConfigValues.OAUTHCONFIG || key === AppConfigValues.AUTH_CONFIG) {
|
||||||
return (JSON.parse(this.storage.getItem(key)) || super.get<T>(key, defaultValue));
|
return (JSON.parse(this.storage.getItem(key)) || super.get<T>(key, defaultValue));
|
||||||
} else if (key === AppConfigValues.APPLICATION) {
|
} else if (key === AppConfigValues.APPLICATION) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
@@ -151,7 +151,6 @@ const defaultConfig: LegacyMonolithCoreModuleConfig = {
|
|||||||
})
|
})
|
||||||
export class CoreModule {
|
export class CoreModule {
|
||||||
static forRoot(config: LegacyMonolithCoreModuleConfig = defaultConfig): ModuleWithProviders<CoreModule> {
|
static forRoot(config: LegacyMonolithCoreModuleConfig = defaultConfig): ModuleWithProviders<CoreModule> {
|
||||||
debugger;
|
|
||||||
return {
|
return {
|
||||||
ngModule: CoreModule,
|
ngModule: CoreModule,
|
||||||
providers: [
|
providers: [
|
||||||
|
Reference in New Issue
Block a user