@@ -64,12 +64,12 @@ func NewKeycloakProvider(p *ProviderData) *KeycloakProvider {
64// email and groups.
64// email and groups.
65func (p *KeycloakProvider) EnrichSession(ctx context.Context, s *sessions.SessionState) error {
65func (p *KeycloakProvider) EnrichSession(ctx context.Context, s *sessions.SessionState) error {
66 // Fallback to ValidateURL if ProfileURL not set for legacy compatibility
66 // Fallback to ValidateURL if ProfileURL not set for legacy compatibility
67− userinfoURL := p.ValidateURL.String()
67+ profileURL := p.ValidateURL.String()
68− if p.ProfileURL != nil {
68+ if p.ProfileURL.String() != "" {
69− userinfoURL = p.ProfileURL.String()
69+ profileURL = p.ProfileURL.String()
72− json, err := requests.New(userinfoURL).
72+ json, err := requests.New(profileURL).
73 WithContext(ctx).
73 WithContext(ctx).
74 SetHeader("Authorization", "Bearer "+s.AccessToken).
74 SetHeader("Authorization", "Bearer "+s.AccessToken).