IdentityServer configuration to use it with SPA that is not hosted with IdentityServer

IdentityServer settings configuration to use it with SPA that is not hosted with IdentityServer. For example, we have client app on http://localhost:4200 and backend app on https://localhost:5001. To allow working it, we need to set/change “Profile” to “SPA”. Additional we can configure “RedirectUri” and “LogoutUri”.

Backend side (.NET Core 3.1).
Code snippet of appsettings.json:

appsettings.json
  // "IdentityServer": {
  //   "Clients": {
  //     "crypto-web-app": {
  //       "Profile": "IdentityServerSPA"
  //     }
  //   }
  // },

  "IdentityServer": {
    "Clients": {
      "crypto-web-app": {
        "Profile": "SPA",
        "RedirectUri": "http://localhost:4200/authentication/login-callback",
        "LogoutUri": "http://localhost:4200/authentication/logout-callback"
      }
    }
  },

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: