wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
741 stars 719 forks source link

Authentication request signing fails when tenant is not loaded #11636

Open mcintirej3 opened 3 years ago

mcintirej3 commented 3 years ago

Describe the issue: Federated SAML2 authentication fails when authentication request signing is enabled and a tenant is not loaded

How to reproduce:

Example request

https://localhost:9443/oauth2/authorize?scope=openid&client_id=<SP_client_id>&client_secret=<SP_client_secret>&redirect_uri=<SP_callback_url>&response_type=code

Observed logfile

TID: [1] [] [2021-04-22 03:37:05,076] [6a17e9fa-6859-4aa9-a1af-276ca6d3e15a] ERROR {org.wso2.carbon.core.util.KeyStoreManager} - Error loading the private key from the key store : sample-tenant.jks
TID: [-1234] [] [2021-04-22 03:37:05,077] [6a17e9fa-6859-4aa9-a1af-276ca6d3e15a] ERROR {org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler} - Authentication failed exception! Error retrieving private key and the certificate for tenant sample.tenant

Expected behavior: Federated SAML authentication should be able to sign authentication requests without the tenant needing to be actively loaded.

Environment information


Optional Fields

Related issues: https://github.com/wso2/product-is/issues/6322

Suggested labels: bug

ruwanta commented 3 years ago

Thanks @mcintirej3 . This might be due to the fact that SAML configurations are stored in the registry. that explains the need for tenant loading. Better the SAML configuration also can be moved to its specific database table similar to OIDC.