@@ -11,8 +11,6 @@ import (
1111	"strings" 
1212	"time" 
1313
14- 	// HashiCorp CAP (Cloud Authentication Primitives) library for OIDC flows 
15- 	// Provides enhanced OIDC support including private key JWT client authentication 
1614	"github.com/hashicorp/cap/oidc" 
1715	cass "github.com/hashicorp/cap/oidc/clientassertion" 
1816
@@ -91,10 +89,6 @@ func (a *Authenticator) ClaimsFromAuthCode(ctx context.Context, stateParam, code
9189		}
9290	}
9391
94- 	// Use HashiCorp CAP provider for token exchange 
95- 	// This provider supports private key JWT client authentication if configured 
96- 	provider  :=  a .capProvider 
97- 
9892	// Use the stored request object from the initial authorization request 
9993	if  state .request  ==  nil  {
10094		a .logger .Error ("Request object not found in state" , "stateParam" , stateParam )
@@ -103,6 +97,10 @@ func (a *Authenticator) ClaimsFromAuthCode(ctx context.Context, stateParam, code
10397		}
10498	}
10599
100+ 	// Use HashiCorp CAP provider for token exchange 
101+ 	// This provider supports private key JWT client authentication if configured 
102+ 	provider  :=  a .capProvider 
103+ 
106104	tokens , err  :=  provider .Exchange (ctx , state .request , stateParam , code )
107105	if  err  !=  nil  {
108106		return  nil , nil , & ProviderLoginFailedError {
0 commit comments