Client Seeding
When developing a Backend For Frontend or an UI app that integrates with
authentication it is required to register clients for them.
Backend For Frontends
Our bff require a client for using the introspection endpoint to resolve
reference tokens.
C# |
---|
| public static ClientCreationDto Interactive { get; } = new ClientCreationDto(
ClientId: "admin-center-bff",
AllowedScopes: new string[0],
AllowOfflineAccess: false,
ClientSecrets: "<Insert NewId here>",
RedirectUris: new string[0],
PostLogoutRedirectUris: new string[0],
AllowedGrantTypes: new string[0],
AllowedCorsOrigins: new string[0]);
|
UI Clients
Our UIs use Authorization Code, so we need to seed a client for our UI like so:
C# |
---|
| public static ClientCreationDto AdminCenter { get; } = new ClientCreationDto(
ClientId: "admin-center",
AllowOfflineAccess: true,
AllowedScopes: new string[]
{
Scopes.Openid.Name,
Scopes.Profile.Name,
Scopes.OfflineAccess.Name,
},
ClientSecrets: "<Insert NewId here>",
RedirectUris: new string[]
{
// Replace URLs with the one of the ui app
"http://localhost:4200/oidc-token-callback",
"https://admin-center.localdev.suite.itsynch.com/oidc-token-callback",
"https://admin-center.dev.suite.itsynch.com/oidc-token-callback",
"https://admin-center.staging.suite.itsynch.com/oidc-token-callback",
},
PostLogoutRedirectUris: new string[]
{
"http://localhost:4200",
"https://admin-center.localdev.suite.itsynch.com",
"https://admin-center.dev.suite.itsynch.com",
"https://admin-center.staging.suite.itsynch.com",
},
AllowedGrantTypes: new string[] { "authorization_code" },
AllowedCorsOrigins: new string[]
{
"http://localhost:4200",
"https://admin-center.localdev.suite.itsynch.com",
"https://admin-center.dev.suite.itsynch.com",
"https://admin-center.staging.suite.itsynch.com",
});
|