-
Notifications
You must be signed in to change notification settings - Fork 446
backend: headlamp: Add pkce support #3692
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
base: main
Are you sure you want to change the base?
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 | ||||
---|---|---|---|---|---|---|
|
@@ -138,6 +138,13 @@ spec: | |||||
name: {{ $oidc.secret.name }} | ||||||
key: useAccessToken | ||||||
{{- end }} | ||||||
{{- if $oidc.usePKCE }} | ||||||
- name: OIDC_USE_PKCE | ||||||
valueFrom: | ||||||
secretKeyRef: | ||||||
name: {{ $oidc.secret.name }} | ||||||
key: usePKCE | ||||||
{{- end }} | ||||||
{{- else }} | ||||||
{{- if $oidc.clientID }} | ||||||
- name: OIDC_CLIENT_ID | ||||||
|
@@ -167,6 +174,10 @@ spec: | |||||
- name: OIDC_USE_ACCESS_TOKEN | ||||||
value: {{ $oidc.useAccessToken }} | ||||||
{{- end }} | ||||||
{{- if $oidc.usePKCE }} | ||||||
- name: OIDC_USE_PKCE | ||||||
value: {{ $oidc.usePKCE }} | ||||||
{{- end }} | ||||||
{{- end }} | ||||||
{{- if .Values.env }} | ||||||
{{- toYaml .Values.env | nindent 12 }} | ||||||
|
@@ -213,6 +224,10 @@ spec: | |||||
# Check if useAccessToken is non false either from env or oidc.config | ||||||
- "-oidc-use-access-token=$(OIDC_USE_ACCESS_TOKEN)" | ||||||
{{- end }} | ||||||
{{- if or (ne ($oidc.usePKCE | toString) "false") (ne $usePKCE "") }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
# Check if usePKCE is non false either from env or oidc.config | ||||||
- "-oidc-use-pkce=$(OIDC_USE_PKCE)" | ||||||
{{- end }} | ||||||
{{- else }} | ||||||
- "-oidc-client-id=$(OIDC_CLIENT_ID)" | ||||||
- "-oidc-client-secret=$(OIDC_CLIENT_SECRET)" | ||||||
|
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
oauth2.SetAuthURLParam
function is being used incorrectly for token exchange. For PKCE token exchange, you should useoauth2.SetAuthURLParam
with theExchange
method, but the parameter should be passed as an option toExchange
, not as an auth URL parameter. Useoauth2.SetAuthURLParam("code_verifier", oauthConfig.CodeVerifier)
as an option to theExchange
call.Copilot uses AI. Check for mistakes.