Repository navigation
feat(oauth): add client branding support for OAuth authorization pages #9
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,6 +173,34 @@ module.exports = defineConfig((commandLineArguments) => { | |
| application_type: 'web', | ||
| token_endpoint_auth_method: 'none', | ||
| dpop_bound_access_tokens: true, | ||
| // Custom branding for trusted clients | ||
| // This CSS will be injected into the authorization page when this client is trusted | ||
| branding: { | ||
| css: ` | ||
| /* SDS Demo Custom Branding */ | ||
| :root { | ||
| --branding-color-primary: 99 102 241; | ||
| --branding-color-primary-contrast: 255 255 255; | ||
| --branding-color-primary-hue: 239; | ||
| } | ||
|
|
||
| /* Custom button styling */ | ||
| button[type="submit"] { | ||
| background: linear-gradient(135deg, rgb(99 102 241) 0%, rgb(139 92 246) 100%) !important; | ||
| box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39) !important; | ||
| } | ||
|
|
||
| /* Add a subtle brand indicator */ | ||
| .auth-form::before { | ||
| content: "Powered by SDS Demo"; | ||
| display: block; | ||
| text-align: center; | ||
| font-size: 0.75rem; | ||
| color: rgb(99 102 241); | ||
| margin-bottom: 1rem; | ||
| } | ||
|
Comment on lines
+193
to
+201
|
||
| `.trim(), | ||
| }, | ||
| } | ||
|
|
||
| this.emitFile({ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSS generation has been moved from pre-computation (line 17 in the factory function) to per-request computation inside the handler function. This creates a performance regression because buildCustomizationCss will be called for every authorization request instead of once when the factory is initialized.
For authorization pages that don't use client branding (non-trusted clients or clients without branding), this adds unnecessary overhead on every request. Consider maintaining the pre-computed customizationCss for the base case and only computing client-specific CSS when needed.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed as #14 to be done as a follow-up.