Class OpenIDConnectionUtils
- java.lang.Object
-
- io.fabric8.kubernetes.client.utils.OpenIDConnectionUtils
-
public class OpenIDConnectionUtils extends Object
Utility class for OpenID token refresh.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenIDConnectionUtils.OAuthTokenstatic classOpenIDConnectionUtils.OpenIdConfiguration
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanidTokenExpired(Config config)static OpenIDConnectionUtils.OAuthTokenpersistOAuthToken(Config currentConfig, OpenIDConnectionUtils.OAuthToken oAuthToken, String token)Save Updated Access and Refresh token in local KubeConfig file and in-memory Config object.static CompletableFuture<String>resolveOIDCTokenFromAuthConfig(Config currentConfig, Map<String,String> currentAuthProviderConfig, HttpClient.Builder clientBuilder)Fetch OpenID Connect token from Kubeconfig, check whether it's still valid or not; If expired handle token refresh with OpenID Connection provider APIs
-
-
-
Method Detail
-
resolveOIDCTokenFromAuthConfig
public static CompletableFuture<String> resolveOIDCTokenFromAuthConfig(Config currentConfig, Map<String,String> currentAuthProviderConfig, HttpClient.Builder clientBuilder)
Fetch OpenID Connect token from Kubeconfig, check whether it's still valid or not; If expired handle token refresh with OpenID Connection provider APIs- Parameters:
currentAuthProviderConfig- current AuthInfo's AuthProvider config as a map- Returns:
- access token for interacting with Kubernetes API
-
persistOAuthToken
public static OpenIDConnectionUtils.OAuthToken persistOAuthToken(Config currentConfig, OpenIDConnectionUtils.OAuthToken oAuthToken, String token)
Save Updated Access and Refresh token in local KubeConfig file and in-memory Config object.- Parameters:
currentConfig- current Config object.oAuthToken- OAuth token information as received from OpenID provider.token- new token to be persisted in KubeConfig (if not null).- Returns:
- the oAuthToken for chaining and further processing.
-
idTokenExpired
public static boolean idTokenExpired(Config config)
-
-