Use client id instead of principal name if it's available
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2e880282 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2e880282 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2e880282 Branch: refs/heads/3.1.x-fixes Commit: 2e88028254a89e6ecea2bf607b50f60d66aaeaae Parents: 13521bd Author: Colm O hEigeartaigh <[email protected]> Authored: Fri Nov 13 12:25:57 2015 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Fri Nov 13 13:37:01 2015 +0000 ---------------------------------------------------------------------- .../cxf/rs/security/oauth2/services/AbstractTokenService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/2e880282/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java index 29eadcb..61e3165 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java @@ -65,12 +65,12 @@ public class AbstractTokenService extends AbstractOAuthService { client = getAndValidateClientFromIdAndSecret(clientId, params.getFirst(OAuthConstants.CLIENT_SECRET)); } - } else if (principal.getName() != null) { - client = getClient(principal.getName()); } else { String clientId = retrieveClientId(params); if (clientId != null) { client = getClient(clientId); + } else if (principal.getName() != null) { + client = getClient(principal.getName()); } } if (client == null) {
