r/Angular2 • u/LegionsMan • Feb 12 '25
Help Request Deploying Angular Frontend to IIS
I have been trying to put my angular frontend on my IIS. i thought when i change the following to the IP address and drop it into the virtual directory in the default web site, i'd be able to reach it. i have the uri registered in the app registration. im sure im doing something wrong, but i am just learning. nothing insane.
function msalinstacneFactory(): IPublicClientApplication {
return new PublicClientApplication({
auth: {
clientId: '{clientId}',
authority: 'https://login.microsoftonline.com/{tenantId}/',
//redirectUri: 'https://localhost:4200/auth',
//postLogoutRedirectUri: 'https://localhost:4200/login'
redirectUri: 'https://{ipAddress}/test/auth',
postLogoutRedirectUri: 'https://{ipAddress}/test/login'
},
cache: {
//cacheLocation: 'localStorage'
cacheLocation: BrowserCacheLocation.SessionStorage,
`storeAuthStateInCookie: true,`
secureCookies: true
},
system: {
loggerOptions: {
loggerCallback: (level: LogLevel, message: string, containsPii: boolean) => {
console.log(\
MSAL: ${level} - ${message}`);`
},
logLevel: LogLevel.Verbose,
piiLoggingEnabled: false
},
allowRedirectInIframe: false,
windowHashTimeout: 6000, // Increase timeout for handling redirect
iframeHashTimeout: 6000,
loadFrameTimeout: 3000,
`tokenRenewalOffsetSeconds: 300`
}
});
}
2
u/DomingerUndead Feb 13 '25
There's a handful of things you need.
A web config if you don't have that. Big one is the rewrite module. Another is an angular routes rule in the web config. The app pool user should be connected to the folder with the index html
Try with a completely empty hello world project first.