mirror of
https://github.com/tale/headplane.git
synced 2026-08-27 15:37:04 +00:00
feat: allow setting OIDC_CLIENT_SECRET_METHOD
This commit is contained in:
@@ -28,6 +28,7 @@ export interface HeadplaneContext {
|
|||||||
client: string
|
client: string
|
||||||
secret: string
|
secret: string
|
||||||
rootKey: string
|
rootKey: string
|
||||||
|
method: string
|
||||||
disableKeyLogin: boolean
|
disableKeyLogin: boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,6 +144,7 @@ async function checkOidc(config?: HeadscaleConfig) {
|
|||||||
let issuer = process.env.OIDC_ISSUER
|
let issuer = process.env.OIDC_ISSUER
|
||||||
let client = process.env.OIDC_CLIENT_ID
|
let client = process.env.OIDC_CLIENT_ID
|
||||||
let secret = process.env.OIDC_CLIENT_SECRET
|
let secret = process.env.OIDC_CLIENT_SECRET
|
||||||
|
let method = process.env.OIDC_CLIENT_SECRET_METHOD ?? 'client_secret_basic'
|
||||||
|
|
||||||
log.debug('CTXT', 'Checking OIDC environment variables')
|
log.debug('CTXT', 'Checking OIDC environment variables')
|
||||||
log.debug('CTXT', 'Issuer: %s', issuer)
|
log.debug('CTXT', 'Issuer: %s', issuer)
|
||||||
@@ -161,6 +163,7 @@ async function checkOidc(config?: HeadscaleConfig) {
|
|||||||
issuer,
|
issuer,
|
||||||
client,
|
client,
|
||||||
secret,
|
secret,
|
||||||
|
method,
|
||||||
rootKey,
|
rootKey,
|
||||||
disableKeyLogin,
|
disableKeyLogin,
|
||||||
}
|
}
|
||||||
@@ -204,6 +207,7 @@ async function checkOidc(config?: HeadscaleConfig) {
|
|||||||
client,
|
client,
|
||||||
secret,
|
secret,
|
||||||
rootKey,
|
rootKey,
|
||||||
|
method,
|
||||||
disableKeyLogin,
|
disableKeyLogin,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -36,7 +36,7 @@ export async function startOidc(oidc: OidcConfig, req: Request) {
|
|||||||
const issuerUrl = new URL(oidc.issuer)
|
const issuerUrl = new URL(oidc.issuer)
|
||||||
const oidcClient = {
|
const oidcClient = {
|
||||||
client_id: oidc.client,
|
client_id: oidc.client,
|
||||||
token_endpoint_auth_method: 'client_secret_basic',
|
token_endpoint_auth_method: oidc.method,
|
||||||
} satisfies Client
|
} satisfies Client
|
||||||
|
|
||||||
const response = await discoveryRequest(issuerUrl)
|
const response = await discoveryRequest(issuerUrl)
|
||||||
@@ -91,7 +91,7 @@ export async function finishOidc(oidc: OidcConfig, req: Request) {
|
|||||||
const oidcClient = {
|
const oidcClient = {
|
||||||
client_id: oidc.client,
|
client_id: oidc.client,
|
||||||
client_secret: oidc.secret,
|
client_secret: oidc.secret,
|
||||||
token_endpoint_auth_method: 'client_secret_basic',
|
token_endpoint_auth_method: oidc.method,
|
||||||
} satisfies Client
|
} satisfies Client
|
||||||
|
|
||||||
const response = await discoveryRequest(issuerUrl)
|
const response = await discoveryRequest(issuerUrl)
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ If you use the Headscale configuration integration, these are not required.
|
|||||||
- **`OIDC_ISSUER`**: The issuer URL of your OIDC provider.
|
- **`OIDC_ISSUER`**: The issuer URL of your OIDC provider.
|
||||||
- **`OIDC_CLIENT_ID`**: The client ID of your OIDC provider.
|
- **`OIDC_CLIENT_ID`**: The client ID of your OIDC provider.
|
||||||
- **`OIDC_CLIENT_SECRET`**: The client secret of your OIDC provider.
|
- **`OIDC_CLIENT_SECRET`**: The client secret of your OIDC provider.
|
||||||
|
- **`OIDC_CLIENT_SECRET_METHOD`**: The method used to send the client secret (default: `client_secret_basic`).
|
||||||
- **`ROOT_API_KEY`**: An API key used to issue new ones for sessions (keep expiry fairly long).
|
- **`ROOT_API_KEY`**: An API key used to issue new ones for sessions (keep expiry fairly long).
|
||||||
- **`DISABLE_API_KEY_LOGIN`**: If you want to disable API key login, set this to `true`.
|
- **`DISABLE_API_KEY_LOGIN`**: If you want to disable API key login, set this to `true`.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user