Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Angular 17 with SSR (Universal) #1898

Open
m-prolic opened this issue Feb 5, 2024 · 1 comment
Open

[Question]: Angular 17 with SSR (Universal) #1898

m-prolic opened this issue Feb 5, 2024 · 1 comment
Labels

Comments

@m-prolic
Copy link

m-prolic commented Feb 5, 2024

What Version of the library are you using? 17.0.0

Angular version: 17.1.2

provideRouter( routesAuth,withPreloading(PreloadAllModules), withInMemoryScrolling({ scrollPositionRestoration: 'enabled' }), withEnabledBlockingInitialNavigation() ), provideAuth(authConfig), { provide: AbstractSecurityStorage, useClass: LocalStorage }, provideHttpClient(withFetch(), withInterceptors([authInterceptor(), agoraLoadingInterceptor])), .....

export const authConfig: PassedInitialConfig = { config: { triggerAuthorizationResultEvent: true, postLoginRoute: '/home', forbiddenRoute: '/forbidden', unauthorizedRoute: '/unauthorized', logLevel: LogLevel.Debug, historyCleanupOff: true, authority: 'https://demo.duendesoftware.com/', redirectUrl: 'http://localhost:4200/', postLogoutRedirectUri: 'http://localhost:4200/', clientId: 'interactive.public', scope: 'openid profile email api offline_access', responseType: 'code' }, };
We are using Authorization Code + PKCE - Duende identity server

Question

Does the library support Angular 17 with SSR ?

I am getting the next errors in the SERVER console:

image

image

Is it possible to get pages authorized/guarded rendered in SSR?

I've tried to implement Cookie Storage and provide it to app.config.server.json, but I am still getting messages that Storage is falsy/undefiend.

`
const serverConfig: ApplicationConfig = {
providers: [provideServerRendering(), provideHttpClient(), { provide: LocalStorage, useClass: ServerStorage }],
};

export const config = mergeApplicationConfig(appConfig, serverConfig);
`

@Desnoo
Copy link

Desnoo commented Apr 26, 2024

The first issue seems related to this Code https://github.com/damienbod/angular-auth-oidc-client/blob/main/projects/angular-auth-oidc-client/src/lib/utils/crypto/crypto.service.ts

It seems like the angular domino browser (server side) has no crypto property. This only happens on the server side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants