'How do I create a second Angular App inside Angular project, in ABP.IO and make IdentityServer work?
ABP Framework version: v4.3.0
User Interface: Angular v11.2.11
Database provider: EF Core
How do I create a second Angular App inside Angular project, in a way that allows me to consume the same C# proxy, and also use the same IdentityServer?
What I've tried so far:
- Made the second app via angular command
ng generate application exampleAppand started moving dependencies from ABP Angular project app.module. - The second app runs on port
4300sohttp://localhost:4300was added toCorsOriginsinappsettings - Under appsettings in DbMigrator project and under IdentityServer:Clients added the following:
"exampleApp": {
"ClientId": "exampleApp",
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:4300"
}
- In the exampleApp environment.ts the following was added:
const baseUrl = 'http://localhost:4300';
export const environment = {
production: false,
application: {
baseUrl,
name: 'exampleApp',
logoUrl: '',
},
oAuthConfig: {
issuer: 'https://localhost:44350',
redirectUri: baseUrl,
clientId: 'exampleApp',
responseType: 'code',
scope: 'offline_access exampleApp'
},
apis: {
default: {
url: 'https://localhost:44350',
rootNamespace: 'AB.XYZ',
},
},
} as Environment;
When I serve exampleApp on port 4300 then try to login it redirects me to the primary app on port 4200.
Could you please provide me with guidance?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
