binarycat0 commented on code in PR #168:
URL: https://github.com/apache/polaris-tools/pull/168#discussion_r2852249890


##########
console/src/api/auth.ts:
##########
@@ -107,9 +110,110 @@ export const authApi = {
 
   logout: (): void => {
     apiClient.clearAccessToken()
-    // Use a small delay to allow toast to show before redirect
+    clearPKCESession()
     setTimeout(() => {
       navigate("/login", true)
     }, 100)
   },
+
+  initiateOIDCFlow: async (): Promise<void> => {
+    const issuerUrl = config.OIDC_ISSUER_URL
+    const clientId = config.OIDC_CLIENT_ID
+    const redirectUri = config.OIDC_REDIRECT_URI
+    const scope = config.OIDC_SCOPE
+
+    if (!issuerUrl || !clientId || !redirectUri) {
+      throw new Error("OIDC configuration is incomplete. Please check 
environment variables.")
+    }
+
+    clearPKCESession()
+
+    const discovery = await discoverOIDCEndpoints(issuerUrl)
+    const authorizationUrl = discovery.authorization_endpoint
+
+    const { verifier, challenge } = await generatePKCE()
+    const state = generateState()
+
+    storePKCEVerifier(verifier)
+    storeState(state)
+
+    const params = new URLSearchParams({
+      response_type: "code",
+      client_id: clientId,
+      redirect_uri: redirectUri,
+      scope: scope,
+      state: state,
+      code_challenge: challenge,
+      code_challenge_method: "S256",
+      prompt: "login",

Review Comment:
   Hi there! The idea was exactly to trigger refresh auth. But I agree that it 
is worth to make it configurable as the rest of parameters. I suggest 
addressing this and the others to a follow-up Issue.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to