Skip to content

Unable to execute SAML Assertion AttributeQuery for users stored in secondary user datastores. #294

@Kktheoch

Description

@Kktheoch

Description:
After a succesful login with SAML for a user stored in a seconday user store I am trying to query the attributes of the user from the IdP since there is a dynamic attribute that may change.

Although the validation of the query partially succeeds in SAMLSubjectQueryValidator.validateSubject() the user store that is loaded is the primary userstore, so UserStoreManager.isExistingUser() returns false since the user is unknown in the primary datastore of a tenant, causing the entire query to fail with Unknown subject.

Suggested Labels:

Suggested Assignees:

Affected Product Version: 5.9.0

OS, DB, other environment details and versions:
org.wso2.carbon.identity.inbound.auth.saml2 running version is 5.6.14

Steps to reproduce:

  1. Create a secondary user datastore with appropriate connections. In my example the secondary datastore is connecting to a MySQL instance.
  2. Create a Service Provider
  3. Login to the service provider using a user stored in a secondary datastore.
  4. Retrieve nameId from the assertion response and try to execute an AttributeQuery for that nameId

Related Issues:
The org.wso2.carbon.identity.query.saml bundle seems to be completely unaware of any secondary user datastores. The primary datastore is used for every operation. This applies to both tenants and super tenant.

The AttributeQuery is executed using SAMLAttributeQueryRequestClient from saml-query-profile-client from samples-is version 4.2.1.

Complete SAML response - request can be provided in case they are needed.

SAML Assertion query doc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions