[
https://issues.apache.org/jira/browse/OAK-5304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
angela resolved OAK-5304.
-------------------------
Resolution: Fixed
Fix Version/s: 1.5.18
> DefaultSyncContext.sync(ExternalIdentity) does not verify same identity
> provider
> --------------------------------------------------------------------------------
>
> Key: OAK-5304
> URL: https://issues.apache.org/jira/browse/OAK-5304
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: auth-external
> Affects Versions: 1.5.15, 1.4.11
> Reporter: Alexander Klimetschek
> Fix For: 1.5.18
>
>
> Since OAK-4224, the external IDP should be verified to be the same, but
> {{DefaultSyncContext.sync(ExternalIdentity)}} doesn't do that, as it [only
> looks|https://github.com/apache/jackrabbit-oak/blob/618e680c9c03fe7f2cd18f7db627f3b969311aac/oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/basic/DefaultSyncContext.java#L226]
> at {{ExternalIdentityRef.getProviderName()}}, but never at the
> {{rep:externalId}} of the (existing) authorizable as it is [done
> in|https://github.com/apache/jackrabbit-oak/blob/618e680c9c03fe7f2cd18f7db627f3b969311aac/oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/basic/DefaultSyncContext.java#L285-L286]
> {{DefaultSyncContext.sync(String)}}.
> The ExternalIdentity's provider will usually match the one from the context,
> and it's important to check against the existing local user's rep:externalId
> in case it was synced with a different IDP beforehand (as per the intention
> in OAK-4224 afaiu, and as done for group memberships in OAK-4397).
> Assume there is
> * a user with the authorizable id "frank"
> * a {{rep:externalId}} with provider "alpha" or no such property (because
> locally created)
> * a sync {{context}} using provider "beta"
> Calling by id:
> {code:java}
> context.sync("frank") => result has Status.FOREIGN
> {code}
> Calling by external id:
> {code:java}
> ExternalIdentity externalId = ...
> // externalId.getId() => "frank"
> // externalId.getExternalId().getProviderName() => "beta"
> context.sync(externalId) => result has Status.UPDATE
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)