Skip to content

fix (jans-kc-saml): Jans SAML is not working #10718

@imShakil

Description

@imShakil

Describe the bug
Jans SAML is not working. While creating TR and uploading metadata it shows like below:

Image

But I don't see such file inside /opt/idp/configs/keycloak/sp/metadata directory.

and from /opt/kc-scheduler/logs/scheduler.log, I got the following error:

2025-01-23 04:10:02,935:INFO  [io.jans.kc.scheduler.App:58] - Application starting ...
2025-01-23 04:10:02,945:INFO  [io.jans.kc.scheduler.App:60] - Loading application configuration
2025-01-23 04:10:02,947:INFO  [io.jans.kc.scheduler.App:62] - Application configuration loaded successfully. Application version: v1.3.0
2025-01-23 04:10:02,977:INFO  [io.jans.kc.scheduler.App:65] - Setting up access to external apis
2025-01-23 04:10:03,056:INFO  [io.jans.kc.scheduler.App:70] - Initialization additional application objects
2025-01-23 04:10:03,304:INFO  [io.jans.kc.scheduler.App:74] - Running as cron, skiping scheduler initialization
2025-01-23 04:10:06,571:INFO  [io.jans.kc.scheduler.TrustRelationshipSyncJob:55] - Performing Saml client housekeeping
2025-01-23 04:10:06,808:INFO  [io.jans.kc.scheduler.TrustRelationshipSyncJob:57] - Saml client housekeeping complete
2025-01-23 04:10:06,809:INFO  [io.jans.kc.scheduler.TrustRelationshipSyncJob:59] - Creating new managed saml clients
2025-01-23 04:10:07,222:WARN  [io.jans.kc.scheduler.TrustRelationshipSyncJob:127] - Could not create managed SAML client using tr with inum 92cdea11-bfb0-4945-95ea-0d66b3054a70
2025-01-23 04:10:07,235:WARN  [io.jans.kc.scheduler.TrustRelationshipSyncJob:128] - Resulting exception:
io.jans.kc.api.config.client.JansConfigApiError: getTrustRelationshipSamlMetadata() failed
	at io.jans.kc.api.config.client.JansConfigApi.getTrustRelationshipFileMetadata(JansConfigApi.java:102)
Caused by: io.jans.config.api.client.ApiException: {"code":"404","message":"The requested metadata file for tr '92cdea11-bfb0-4945-95ea-0d66b3054a70'  doesn't exist"}
	at io.jans.config.api.client.ApiClient.invokeAPI(ApiClient.java:693)
2025-01-23 04:10:07,343:WARN  [io.jans.kc.scheduler.TrustRelationshipSyncJob:127] - Could not create managed SAML client using tr with inum 8d032a06-8774-49f2-84d9-68dc4d590b17
2025-01-23 04:10:07,344:WARN  [io.jans.kc.scheduler.TrustRelationshipSyncJob:128] - Resulting exception:
io.jans.kc.api.config.client.JansConfigApiError: getTrustRelationshipSamlMetadata() failed
	at io.jans.kc.api.config.client.JansConfigApi.getTrustRelationshipFileMetadata(JansConfigApi.java:102)
Caused by: io.jans.config.api.client.ApiException: {"code":"404","message":"The requested metadata file for tr '8d032a06-8774-49f2-84d9-68dc4d590b17'  doesn't exist"}
	at io.jans.config.api.client.ApiClient.invokeAPI(ApiClient.java:693)
2025-01-23 04:10:07,345:INFO  [io.jans.kc.scheduler.TrustRelationshipSyncJob:61] - Creating new managed saml clients complete
2025-01-23 04:10:07,345:INFO  [io.jans.kc.scheduler.TrustRelationshipSyncJob:63] - Updating existing managed saml clients
2025-01-23 04:10:07,531:INFO  [io.jans.kc.scheduler.TrustRelationshipSyncJob:65] - Updating existing managed saml clients complete
2025-01-23 04:10:07,532:INFO  [io.jans.kc.scheduler.App:76] - Jobs run to completion.
2025-01-23 04:10:07,533:INFO  [io.jans.kc.scheduler.App:90] - Application shutting down

To Reproduce
Steps to reproduce the behavior:

  1. install janssen server
  2. create a SAML TR
  3. test SSO flow
  4. see logs in kc-scheduler.

Expected behavior
Client should be added in KC while creating TR and SSO should work.

Metadata

Metadata

Assignees

Labels

kind-bugIssue or PR is a bug in existing functionality

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions