You've already forked oauth2-proxy
							
							
				mirror of
				https://github.com/oauth2-proxy/oauth2-proxy.git
				synced 2025-10-30 23:47:52 +02:00 
			
		
		
		
	Handle ValidateURL fallback for nil & empty struct cases
This commit is contained in:
		| @@ -64,12 +64,12 @@ func NewKeycloakProvider(p *ProviderData) *KeycloakProvider { | ||||
| // email and groups. | ||||
| func (p *KeycloakProvider) EnrichSession(ctx context.Context, s *sessions.SessionState) error { | ||||
| 	// Fallback to ValidateURL if ProfileURL not set for legacy compatibility | ||||
| 	userinfoURL := p.ValidateURL.String() | ||||
| 	if p.ProfileURL != nil { | ||||
| 		userinfoURL = p.ProfileURL.String() | ||||
| 	profileURL := p.ValidateURL.String() | ||||
| 	if p.ProfileURL.String() != "" { | ||||
| 		profileURL = p.ProfileURL.String() | ||||
| 	} | ||||
|  | ||||
| 	json, err := requests.New(userinfoURL). | ||||
| 	json, err := requests.New(profileURL). | ||||
| 		WithContext(ctx). | ||||
| 		SetHeader("Authorization", "Bearer "+s.AccessToken). | ||||
| 		Do(). | ||||
|   | ||||
		Reference in New Issue
	
	Block a user