mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-31 22:59:34 +00:00
oidc client auth: better error when refresh response is missing id_token
Kubernetes-commit: a8914b73a12583c29bdee333528a55a5b3e5db1f
This commit is contained in:
committed by
Kubernetes Publisher
parent
350fc9ed99
commit
0b1f8b0d85
@@ -258,7 +258,11 @@ func (p *oidcAuthProvider) idToken() (string, error) {
|
||||
|
||||
idToken, ok := token.Extra("id_token").(string)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("token response did not contain an id_token")
|
||||
// id_token isn't a required part of a refresh token response, so some
|
||||
// providers (Okta) don't return this value.
|
||||
//
|
||||
// See https://github.com/kubernetes/kubernetes/issues/36847
|
||||
return "", fmt.Errorf("token response did not contain an id_token, either the scope \"openid\" wasn't requested upon login, or the provider doesn't support id_tokens as part of the refresh response.")
|
||||
}
|
||||
|
||||
// Create a new config to persist.
|
||||
|
Reference in New Issue
Block a user