xiaohongshu
xiaohongshu
keycloak-auth
Configure cookie-based OIDC authentication with Keycloak for affolterNET.Web.Bff. Use when setting up login/logout, token refresh, or Keycloak integration.
Full skill instructions
Configure cookie-based OIDC authentication with Keycloak.
For complete reference, see Library Guide.
{
"affolterNET": {
"Web": {
"Auth": {
"Provider": {
"Authority": "https://keycloak.example.com/realms/myrealm",
"ClientId": "my-bff-client",
"ClientSecret": "your-client-secret"
},
"CookieAuth": {
"CookieName": ".MyApp.Auth",
"ExpireTimeSpan": "01:00:00"
}
},
"BffOptions": {
"AuthMode": "Authenticate"
}
}
}
}
| Mode | Description |
|---|---|
None | No authentication required |
Authenticate | Valid session required, no permission checks |
Authorize | Valid session + Keycloak RPT permissions required |
The BFF provides these authentication endpoints:
| Endpoint | Method | Description |
|---|---|---|
/bff/account/login | GET | Initiates OIDC login flow |
/bff/account/logout | GET/POST | Logs out user |
/bff/account/user | GET | Returns current user info |
/bff/account/login?returnUrl=/dashboard
| Property | Description |
|---|---|
Authority | Keycloak realm URL |
ClientId | OIDC client identifier |
ClientSecret | OIDC client secret |
| Property | Type | Default | Description |
|---|---|---|---|
CookieName | string | .AspNetCore.Auth | Authentication cookie name |
ExpireTimeSpan | TimeSpan | 01:00:00 | Cookie expiration |
SlidingExpiration | bool | true | Extend cookie on activity |
The RefreshTokenMiddleware automatically refreshes tokens:
The BFF returns 401 instead of redirecting to Keycloak:
// Handle 401 in your SPA
if (response.status === 401) {
window.location.href = '/bff/account/login?returnUrl=' +
encodeURIComponent(window.location.pathname);
}
Authority URL is correctxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience